Linux Kernels

staging: lustre: lov: adjust page bufsize after layout change

This change “staging: lustre: lov: adjust page bufsize after layout change” (commit 3dd282c) in Linux kernel is authored by Jinshan Xiong <jinshan.xiong [at] intel.com> on Sun Sep 18 16:37:16 2016 -0400.

Description of "staging: lustre: lov: adjust page bufsize after layout change"

The change “staging: lustre: lov: adjust page bufsize after layout change” introduces changes as follows.

staging: lustre: lov: adjust page bufsize after layout change

Otherwise, the coh_page_bufsize keeps increasing when the file's
layout keeps changing in lov_init_raid0().

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5459
Reviewed-on: http://review.whamcloud.com/11394
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 3dd282c

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "staging: lustre: lov: adjust page bufsize after layout change"

There are 8 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/lustre/lustre/lov/lov_object.c | 8 ++++++++
 1 file changed, 8 insertions(+)
 
diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c
index 2a52d0c52799..4f766e090ccf 100644
--- a/drivers/staging/lustre/lustre/lov/lov_object.c
+++ b/drivers/staging/lustre/lustre/lov/lov_object.c
@@ -195,6 +195,10 @@ static int lov_page_slice_fixup(struct lov_object *lov,
 	struct cl_object_header *hdr = cl_object_header(&lov->lo_cl);
 	struct cl_object *o;
 
+	if (!stripe)
+		return hdr->coh_page_bufsize - lov->lo_cl.co_slice_off -
+		       cfs_size_round(sizeof(struct lov_page));
+
 	cl_object_for_each(o, stripe)
 		o->co_slice_off += hdr->coh_page_bufsize;
 
@@ -720,6 +724,10 @@ static int lov_layout_change(const struct lu_env *unused,
 		LASSERT(atomic_read(&lov->lo_active_ios) == 0);
 
 		lov->lo_type = LLT_EMPTY;
+		/* page bufsize fixup */
+		cl_object_header(&lov->lo_cl)->coh_page_bufsize -=
+			lov_page_slice_fixup(lov, NULL);
+
 		result = new_ops->llo_init(env,
 					lu2lov_dev(lov->lo_cl.co_lu.lo_dev),
 					lov, conf, state);

The commit for this change in Linux stable tree is 3dd282c (patch).

Last modified: 2020/01/11 09:39