Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1547655 > unrolled thread

[PATCH v1 05/54] fs/buffer: comment on direct access to bvec table

Started byMing Lei <tom.leiming@gmail.com>
First post2016-12-27 17:10 +0100
Last post2016-12-27 17:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v1 05/54] fs/buffer: comment on direct access to bvec table Ming Lei <tom.leiming@gmail.com> - 2016-12-27 17:10 +0100

#1547655 — [PATCH v1 05/54] fs/buffer: comment on direct access to bvec table

FromMing Lei <tom.leiming@gmail.com>
Date2016-12-27 17:10 +0100
Subject[PATCH v1 05/54] fs/buffer: comment on direct access to bvec table
Message-ID<sT2u7-4eA-81@gated-at.bofh.it>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 fs/buffer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index d21771fcf7d3..63d2f40c21fd 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -3060,8 +3060,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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web