[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1459356495-2794775-24-git-send-email-green@linuxhacker.ru>
Date: Wed, 30 Mar 2016 12:47:55 -0400
From: green@...uxhacker.ru
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org,
Andreas Dilger <andreas.dilger@...el.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lustre Development List <lustre-devel@...ts.lustre.org>,
Li Dongyang <dongyang.li@....edu.au>,
Oleg Drokin <green@...uxhacker.ru>
Subject: [PATCH 23/43] staging/lustre/llite: make sure we do cl_page_clip on the last page
From: Li Dongyang <dongyang.li@....edu.au>
When we are doing a partial IO on both first and last page,
the logic currently only call cl_page_clip on the first page, which
will end up with a incorrect i_size.
Signed-off-by: Li Dongyang <dongyang.li@....edu.au>
Reviewed-on: http://review.whamcloud.com/11630
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5552
Reviewed-by: Ian Costello <costello.ian@...il.com>
Reviewed-by: Niu Yawei <yawei.niu@...el.com>
Reviewed-by: Li Xi <pkuelelixi@...il.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@...el.com>
Signed-off-by: Oleg Drokin <green@...uxhacker.ru>
---
drivers/staging/lustre/lustre/llite/vvp_io.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c
index e44ef21..1d2fc3b 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -599,12 +599,14 @@ static int vvp_io_commit_sync(const struct lu_env *env, struct cl_io *io,
page = cl_page_list_first(plist);
if (plist->pl_nr == 1) {
cl_page_clip(env, page, from, to);
- } else if (from > 0) {
- cl_page_clip(env, page, from, PAGE_SIZE);
} else {
- page = cl_page_list_last(plist);
- cl_page_clip(env, page, 0, to);
- }
+ if (from > 0)
+ cl_page_clip(env, page, from, PAGE_SIZE);
+ if (to != PAGE_SIZE) {
+ page = cl_page_list_last(plist);
+ cl_page_clip(env, page, 0, to);
+ }
+ }
}
cl_2queue_init(queue);
--
2.1.0
Powered by blists - more mailing lists