diff mbox series

[27/39] lustre: lov: instantiate components layout for fallocate

Message ID 1611249422-556-28-git-send-email-jsimmons@infradead.org (mailing list archive)
State New
Headers show
Series lustre: update to latest OpenSFS version as of Jan 21 2021 | expand

Commit Message

James Simmons Jan. 21, 2021, 5:16 p.m. UTC
From: Wang Shilong <wshilong@ddn.com>

fallocate() need send intent lock to MDS to instantiate layout
like PFL.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14186
Lustre-commit: 7e25e6c7d0a710 ("LU-14186 lov: instantiate components layout for fallocate")
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/40885
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/vvp_io.c | 2 +-
 fs/lustre/lov/lov_io.c   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/lustre/llite/vvp_io.c b/fs/lustre/llite/vvp_io.c
index 8dbe835..b0b31c37 100644
--- a/fs/lustre/llite/vvp_io.c
+++ b/fs/lustre/llite/vvp_io.c
@@ -361,7 +361,7 @@  static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
 
 		io->ci_need_write_intent = 0;
 
-		LASSERT(io->ci_type == CIT_WRITE ||
+		LASSERT(io->ci_type == CIT_WRITE || cl_io_is_fallocate(io) ||
 			cl_io_is_trunc(io) || cl_io_is_mkwrite(io));
 
 		CDEBUG(D_VFSTRACE, DFID" write layout, type %u " DEXT "\n",
diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index ac88a55..d4a0c9d 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -571,6 +571,7 @@  static int lov_io_slice_init(struct lov_io *lio, struct lov_object *obj,
 
 	/* check if it needs to instantiate layout */
 	if (!(io->ci_type == CIT_WRITE || cl_io_is_mkwrite(io) ||
+	      cl_io_is_fallocate(io) ||
 	      (cl_io_is_trunc(io) && io->u.ci_setattr.sa_attr.lvb_size > 0))) {
 		result = 0;
 		goto out;