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
..
2005-09-17 11:49:58 -07:00
2006-01-01 22:21:50 +01:00
2007-10-20 02:01:11 +01:00
2005-04-16 15:20:36 -07:00
2007-10-20 02:01:11 +01:00
2007-10-20 02:01:12 +01:00
2007-10-20 02:01:07 +01:00
2007-10-20 02:01:18 +01:00
2007-05-09 12:30:47 -07:00
2007-10-20 02:01:23 +01:00
2007-10-20 02:01:21 +01:00
2007-10-20 02:01:21 +01:00
2007-10-20 02:00:57 +01:00
2007-10-20 02:01:27 +01:00
2007-10-20 02:01:07 +01:00
2007-10-20 02:01:06 +01:00
2007-07-12 15:01:08 -07:00
2007-10-20 02:01:06 +01:00
2007-10-20 02:01:07 +01:00
2007-10-20 02:01:26 +01:00
2007-10-20 02:01:26 +01:00
2007-10-20 02:01:26 +01:00
2007-10-20 02:01:24 +01:00
2007-10-20 02:01:08 +01:00
2005-04-16 15:20:36 -07:00
2007-10-20 02:01:24 +01:00
2005-04-16 15:20:36 -07:00
2007-11-14 18:45:39 -08:00
2005-09-17 11:49:58 -07:00
2007-10-29 07:41:32 -07:00
2005-09-17 11:49:58 -07:00
2005-04-16 15:20:36 -07:00
2007-10-29 07:41:32 -07:00
2005-04-16 15:20:36 -07:00
2007-10-29 07:41:32 -07:00
2007-10-29 07:41:32 -07:00
2007-10-29 07:41:32 -07:00
2005-04-16 15:20:36 -07:00