From cec8546638dc634824b629e33968d6c68f8b07d6 Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Mon, 15 Oct 2012 12:24:56 +0200 Subject: s390/css: stop stsch loop after cc 3 Receiving cc=3 from store subchannel means 2 things: * the subchannel is not provided * there are no further subchannels in this subchannel set With this patch we abort the store subchannel loop after cc=3 (or an exception) and clear the subsequent bits in the subchannel id set. Reported-by: Cornelia Huck Signed-off-by: Sebastian Ott Acked-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/idset.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/s390/cio/idset.c') diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c index f0973a04ec49..199bc6791177 100644 --- a/drivers/s390/cio/idset.c +++ b/drivers/s390/cio/idset.c @@ -90,6 +90,14 @@ void idset_sch_del(struct idset *set, struct subchannel_id schid) idset_del(set, schid.ssid, schid.sch_no); } +/* Clear ids starting from @schid up to end of subchannel set. */ +void idset_sch_del_subseq(struct idset *set, struct subchannel_id schid) +{ + int pos = schid.ssid * set->num_id + schid.sch_no; + + bitmap_clear(set->bitmap, pos, set->num_id - schid.sch_no); +} + int idset_sch_contains(struct idset *set, struct subchannel_id schid) { return idset_contains(set, schid.ssid, schid.sch_no); -- cgit v1.2.3