On Tue, 14 Jun 2011 16:25:53 -0700 <[email protected]> wrote: > > This is a note to let you know that I've just added the patch titled > > md/raid5: fix FUA request handling in ops_run_io() > > to the 2.6.33-longterm tree which can be found at: > > http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.33.git;a=summary > > The filename of the patch is: > md-raid5-fix-fua-request-handling-in-ops_run_io.patch > and it can be found in the queue-2.6.33 subdirectory. > > If you, or anyone else, feels it should not be added to the 2.6.33 longterm > tree, > please let <[email protected]> know about it.
Hi Greg, while this patch will not hurt 2.6.33, it is not really necessary. The code in 2.6.33 is already correct. It was only after WRITE_FUA was added that the code stopped being correct. So I don't exactly object to this patch being in 2.6.33, but it is unnecessary so probably best avoided. Thanks, NeilBrown > > > >From b062962edb086011e94ec4d9eb3f6a6d814f2a8f Mon Sep 17 00:00:00 2001 > From: Namhyung Kim <[email protected]> > Date: Tue, 14 Jun 2011 14:20:19 +1000 > Subject: md/raid5: fix FUA request handling in ops_run_io() > > From: Namhyung Kim <[email protected]> > > commit b062962edb086011e94ec4d9eb3f6a6d814f2a8f upstream. > > Commit e9c7469bb4f5 ("md: implment REQ_FLUSH/FUA support") > introduced R5_WantFUA flag and set rw to WRITE_FUA in that case. > However remaining code still checks whether rw is exactly same > as WRITE or not, so FUAed-write ends up with being treated as > READ. Fix it. > > This bug has been present since 2.6.37 and the fix is suitable for any > -stable kernel since then. It is not clear why this has not caused > more problems. > > Cc: Tejun Heo <[email protected]> > Signed-off-by: Namhyung Kim <[email protected]> > Signed-off-by: NeilBrown <[email protected]> > Signed-off-by: Greg Kroah-Hartman <[email protected]> > > --- > drivers/md/raid5.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > --- a/drivers/md/raid5.c > +++ b/drivers/md/raid5.c > @@ -446,7 +446,7 @@ static void ops_run_io(struct stripe_hea > bi = &sh->dev[i].req; > > bi->bi_rw = rw; > - if (rw == WRITE) > + if (rw & WRITE) > bi->bi_end_io = raid5_end_write_request; > else > bi->bi_end_io = raid5_end_read_request; > @@ -480,13 +480,13 @@ static void ops_run_io(struct stripe_hea > bi->bi_io_vec[0].bv_offset = 0; > bi->bi_size = STRIPE_SIZE; > bi->bi_next = NULL; > - if (rw == WRITE && > + if ((rw & WRITE) && > test_bit(R5_ReWrite, &sh->dev[i].flags)) > atomic_add(STRIPE_SECTORS, > &rdev->corrected_errors); > generic_make_request(bi); > } else { > - if (rw == WRITE) > + if (rw & WRITE) > set_bit(STRIPE_DEGRADED, &sh->state); > pr_debug("skip op %ld on disc %d for sector %llu\n", > bi->bi_rw, i, (unsigned long long)sh->sector); > > > Patches currently in longterm-queue-2.6.33 which might be from > [email protected] are > > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/md-raid5-fix-raid5_set_bi_hw_segments.patch > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/brd-limit-max_part-module-param-to-disk_max_parts.patch > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/loop-handle-on-demand-devices-correctly.patch > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/brd-handle-on-demand-devices-correctly.patch > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/loop-limit-max_part-module-param-to-disk_max_parts.patch > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/md-raid5-fix-fua-request-handling-in-ops_run_io.patch > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/md-check-hot_remove_disk-when-removing-disk.patch > /home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/nbd-limit-module-parameters-to-a-sane-value.patch _______________________________________________ stable mailing list [email protected] http://linux.kernel.org/mailman/listinfo/stable
