[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1477728600-12938-20-git-send-email-tom.leiming@gmail.com>
Date: Sat, 29 Oct 2016 16:08:18 +0800
From: Ming Lei <tom.leiming@...il.com>
To: Jens Axboe <axboe@...com>, linux-kernel@...r.kernel.org
Cc: linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Ming Lei <tom.leiming@...il.com>,
Alexander Viro <viro@...iv.linux.org.uk>
Subject: [PATCH 19/60] fs/buffer: comment on direct access to bvec table
Signed-off-by: Ming Lei <tom.leiming@...il.com>
---
fs/buffer.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index b205a629001d..81c3793948b4 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -3018,8 +3018,13 @@ static void end_bio_bh_io_sync(struct bio *bio)
void guard_bio_eod(int op, struct bio *bio)
{
sector_t maxsector;
- struct bio_vec *bvec = &bio->bi_io_vec[bio->bi_vcnt - 1];
unsigned truncated_bytes;
+ /*
+ * It is safe to truncate the last bvec in the following way
+ * even though multipage bvec is supported, but we need to
+ * fix the parameters passed to zero_user().
+ */
+ struct bio_vec *bvec = &bio->bi_io_vec[bio->bi_vcnt - 1];
maxsector = i_size_read(bio->bi_bdev->bd_inode) >> 9;
if (!maxsector)
--
2.7.4
Powered by blists - more mailing lists