[lustre-devel] [PATCH 30/32] lustre: llite: use max default EA size to get default LMV
James Simmons
jsimmons at infradead.org
Wed Aug 3 18:38:15 PDT 2022
From: Lai Siyao <lai.siyao at whamcloud.com>
Subdir mount will fetch ROOT default LMV and set it, but the default
EA size cl_default_mds_easize may not be set for MDT0 yet, because
it's updated upon getattr/enqueue, and if subdir mount is not on MDT0,
it may not be initialized yet. Use max EA size to fetch default
layout in ll_dir_get_default_layout().
Fixes: 4cee9af853 ("lustre: llite: enforce ROOT default on subdir mount")
WC-bug-id: https://jira.whamcloud.com/browse/LU-15910
Lustre-commit: bb588480d4cdd6847 ("LU-15910 llite: use max default EA size to get default LMV")
Signed-off-by: Lai Siyao <lai.siyao at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47937
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson at ddn.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
fs/lustre/llite/dir.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/lustre/llite/dir.c b/fs/lustre/llite/dir.c
index 26c9ec3..3384d81 100644
--- a/fs/lustre/llite/dir.c
+++ b/fs/lustre/llite/dir.c
@@ -663,17 +663,13 @@ int ll_dir_get_default_layout(struct inode *inode, void **plmm, int *plmm_size,
struct mdt_body *body;
struct lov_mds_md *lmm = NULL;
struct ptlrpc_request *req = NULL;
- int rc, lmmsize;
+ int lmmsize = OBD_MAX_DEFAULT_EA_SIZE;
struct md_op_data *op_data;
struct lu_fid fid;
+ int rc;
- rc = ll_get_max_mdsize(sbi, &lmmsize);
- if (rc)
- return rc;
-
- op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL,
- 0, lmmsize, LUSTRE_OPC_ANY,
- NULL);
+ op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, lmmsize,
+ LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
return PTR_ERR(op_data);
--
1.8.3.1
More information about the lustre-devel
mailing list