[PATCH] md: Fix 'rdev->nr_pending' count when retrying barrier requests
commit5e7dd2ab6b9bdfa60e19b8739e6b2a204fd4f477
authorNeilBrown <neilb@suse.de>
Mon, 1 May 2006 19:15:47 +0000 (1 12:15 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 2 May 2006 01:17:42 +0000 (1 18:17 -0700)
treef9d3ac455ea67f1ea23e7e41848ac422506c474b
parent62de608da0b0ab17d81a233b50d1e952b9816f69
[PATCH] md: Fix 'rdev->nr_pending' count when retrying barrier requests

When retrying a failed BIO_RW_BARRIER request, we need to keep the reference
in ->nr_pending over the whole retry.  Currently, we only hold the reference
if the failed request is the *last* one to finish - which is silly, because it
would normally be the first to finish.

So move the rdev_dec_pending call up into the didn't-fail branch.  As the rdev
isn't used in the later code, calling rdev_dec_pending earlier doesn't hurt.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/raid1.c