diff mbox series

[23/26] lustre: mdc: set default LMV on ROOT

Message ID 1627933851-7603-27-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

James Simmons Aug. 2, 2021, 7:50 p.m. UTC
From: Lai Siyao <lai.siyao@whamcloud.com>

To balance MDT usage, set default LMV on ROOT if it's not set. The
default stripe offset is "-1", and default stripe count is "1". Then
directory created by "mkdir" under ROOT will be scattered on all MDTs
by usage.

WC-bug-id: https://jira.whamcloud.com/browse/LU-13417
Lustre-commit: 3e04b0fd6c3dd363 ("LU-13417 mdd: set default LMV on ROOT")
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38553
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/mdc/mdc_request.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/fs/lustre/mdc/mdc_request.c b/fs/lustre/mdc/mdc_request.c
index 1fb9c46..8b94f6c 100644
--- a/fs/lustre/mdc/mdc_request.c
+++ b/fs/lustre/mdc/mdc_request.c
@@ -557,6 +557,13 @@  static int mdc_get_lustre_md(struct obd_export *exp, struct req_capsule *pill,
 			goto out;
 		}
 
+		if (md_exp->exp_obd->obd_type->typ_lu == &mdc_device_type) {
+			CERROR("%s: no LMV, upgrading from old version?\n",
+			       md_exp->exp_obd->obd_name);
+			rc = 0;
+			goto out_acl;
+		}
+
 		if (md->body->mbo_valid & OBD_MD_MEA) {
 			lmv_size = md->body->mbo_eadatasize;
 			if (!lmv_size) {
@@ -618,6 +625,7 @@  static int mdc_get_lustre_md(struct obd_export *exp, struct req_capsule *pill,
 	}
 	rc = 0;
 
+out_acl:
 	/* for ACL, it's possible that FLACL is set but aclsize is zero.
 	 * only when aclsize != 0 there's an actual segment for ACL
 	 * in reply buffer.