Dan Williams 6c55be8b96 raid5: fix unending write sequence
<debug output from Joel's system>
handling stripe 7629696, state=0x14 cnt=1, pd_idx=2 ops=0:0:0
check 5: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800ffcffcc0 written 0000000000000000
check 4: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800fdd4e360 written 0000000000000000
check 3: state 0x1 toread 0000000000000000 read 0000000000000000 write 0000000000000000 written 0000000000000000
check 2: state 0x1 toread 0000000000000000 read 0000000000000000 write 0000000000000000 written 0000000000000000
check 1: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800ff517e40 written 0000000000000000
check 0: state 0x6 toread 0000000000000000 read 0000000000000000 write fffff800fd4cae60 written 0000000000000000
locked=4 uptodate=2 to_read=0 to_write=4 failed=0 failed_num=0
for sector 7629696, rmw=0 rcw=0
</debug>

These blocks were prepared to be written out, but were never handled in
ops_run_biodrain(), so they remain locked forever.  The operations flags
are all clear which means handle_stripe() thinks nothing else needs to be
done.

This state suggests that the STRIPE_OP_PREXOR bit was sampled 'set' when it
should not have been.  This patch cleans up cases where the code looks at
sh->ops.pending when it should be looking at the consistent stack-based
snapshot of the operations flags.

Report from Joel:
	Resync done. Patch fix this bug.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Joel Bertrand <joel.bertrand@systella.fr>
Cc: <stable@kernel.org>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
..
2007-10-17 08:42:52 -07:00
2007-11-14 18:45:39 -08:00
2007-08-22 19:52:46 -07:00
2007-11-02 08:47:06 +01:00
2007-11-14 18:45:39 -08:00
2007-11-14 18:45:37 -08:00
2007-07-21 18:37:12 -07:00
2007-10-29 17:27:50 -04:00
2007-10-16 09:43:09 -07:00
2007-10-19 11:53:42 -07:00
2007-10-20 01:34:40 +02:00
2007-11-05 15:12:31 -08:00
2007-11-05 21:54:41 +00:00
2007-11-14 18:45:38 -08:00
2007-11-14 18:45:39 -08:00
2007-11-05 15:12:31 -08:00
2007-10-20 01:34:40 +02:00
2007-11-10 11:59:49 +01:00
2007-10-23 09:49:31 +02:00
2007-10-19 11:53:41 -07:00
2007-10-19 11:53:41 -07:00
2007-11-14 18:45:36 -08:00
2007-10-20 15:04:06 -07:00
2007-11-14 18:45:39 -08:00
2007-11-14 18:45:39 -08:00
2007-10-17 08:42:57 -07:00
2007-07-18 15:57:16 -07:00
2007-11-02 08:47:06 +01:00
2007-11-14 18:45:36 -08:00
2007-10-23 15:49:54 +10:00