[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181123105024.GA13902@ming.t460p>
Date: Fri, 23 Nov 2018 18:50:26 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Christoph Hellwig <hch@....de>
Cc: Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Theodore Ts'o <tytso@....edu>, Omar Sandoval <osandov@...com>,
Sagi Grimberg <sagi@...mberg.me>,
Dave Chinner <dchinner@...hat.com>,
Kent Overstreet <kent.overstreet@...il.com>,
Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org, Shaohua Li <shli@...nel.org>,
linux-raid@...r.kernel.org, David Sterba <dsterba@...e.com>,
linux-btrfs@...r.kernel.org,
"Darrick J . Wong" <darrick.wong@...cle.com>,
linux-xfs@...r.kernel.org, Gao Xiang <gaoxiang25@...wei.com>,
linux-ext4@...r.kernel.org, Coly Li <colyli@...e.de>,
linux-bcache@...r.kernel.org, Boaz Harrosh <ooo@...ctrozaur.com>,
Bob Peterson <rpeterso@...hat.com>, cluster-devel@...hat.com
Subject: Re: [PATCH V11 15/19] block: enable multipage bvecs
On Wed, Nov 21, 2018 at 05:12:06PM +0100, Christoph Hellwig wrote:
> On Wed, Nov 21, 2018 at 11:48:13PM +0800, Ming Lei wrote:
> > I guess the correct check should be:
> >
> > end_addr = vec_addr + bv->bv_offset + bv->bv_len;
> > if (same_page &&
> > (end_addr & PAGE_MASK) != (page_addr & PAGE_MASK))
> > return false;
>
> Indeed.
The above is still not totally correct, and it should have been:
end_addr = vec_addr + bv->bv_offset + bv->bv_len - 1;
if (same_page && (end_addr & PAGE_MASK) != page_addr)
return false;
Also bv->bv_len should be guaranteed as being bigger than zero.
It also shows that it is quite easy to figure out the last page as
wrong, :-(
Thanks,
Ming
Powered by blists - more mailing lists