From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Moyer Subject: Re: [RFC PATCH] fs/direct-io.c: Set bi_rw when alloc bio. Date: Mon, 30 Jul 2012 09:31:37 -0400 Message-ID: References: <201207271602081096921@gmail.com> <201207300840005466080@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: viro , "Neil Brown" , linux-fsdevel , linux-kernel , linux-raid To: majianpeng Return-path: In-Reply-To: <201207300840005466080@gmail.com> (majianpeng@gmail.com's message of "Mon, 30 Jul 2012 08:40:11 +0800") Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org majianpeng writes: > On 2012-07-27 22:21 Jeff Moyer Wrote: >>majianpeng writes: >> >>> When exec bio_alloc, the bi_rw is zero.But after calling bio_add_page, >>> it will use bi_rw. >>> Fox example, in functiion __bio_add_page,it will call merge_bvec_fn(). >>> The merge_bvec_fn of raid456 will use the bi_rw to judge the merge. >>>>> if ((bvm->bi_rw & 1) == WRITE) >>>>> return biovec->bv_len; /* always allow writes to be mergeable */ >>> >>> Signed-off-by: Jianpeng Ma >> >>Good catch. How did you find this? Did you experience data corruption >>as a result of this oversight, reduced performance due to missed merge >>opportunities, or did you just notice it in reviewing the code? >> >>Reviewed-by: Jeff Moyer >> > Sorry for late to reply. When i analysed the performance of raid5, i found this bug. OK, thanks. In the future, it would be good to include that information in the patch description. Cheers, Jeff