From 5c552e31271824d3512aa9fe8814422b5f6812e0 Mon Sep 17 00:00:00 2001 From: Chris Horn Date: Tue, 4 Jun 2019 14:34:01 -0500 Subject: [PATCH] LU-12387 utils: Read existing ldd data in l_tunedisk Read the lustre_disk_data from the device passed to l_tunedisk, so we can determine whether the device is an MGT or MDT and thus skip the tuning of the device. Lustre-change: https://review.whamcloud.com/35066 Lustre-commit: 9cb4f810164efa5f058dc7605fb1835ea51b0a92 Fixes: 892280742a2b ("LU-9551 utils: add l_tunedisk to fix disk tunings") Fixes: 2f8d7b4679de ("LU-11736 utils: don't set max_sectors_kb on MDT/MGT") Cray-bug-id: LUS-7358 Signed-off-by: Chris Horn Change-Id: I193fe008d5777b0e83f2be9a500eaffb1d3ca615 Reviewed-by: Andreas Dilger Reviewed-by: Gu Zheng Reviewed-by: Nathaniel Clark Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/35370 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons --- lustre/utils/l_tunedisk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lustre/utils/l_tunedisk.c b/lustre/utils/l_tunedisk.c index 47d977b..b02e1e8 100644 --- a/lustre/utils/l_tunedisk.c +++ b/lustre/utils/l_tunedisk.c @@ -44,6 +44,8 @@ int main(int argc, char *const argv[]) struct mount_opts mop = { .mo_max_sectors_kb = -1 }; + struct lustre_disk_data *ldd = &mop.mo_ldd; + char real_path[PATH_MAX] = {'\0'}; unsigned int mount_type; int ret; @@ -73,6 +75,15 @@ int main(int argc, char *const argv[]) if (ret == 0) goto out; + ldd->ldd_mount_type = mount_type; + + ret = osd_read_ldd(mop.mo_source, ldd); + if (ret != 0) { + fprintf(stderr, "Failed to read previous Lustre data from %s " + "(%d)\n", mop.mo_source, ret); + goto out; + } + ret = osd_tune_lustre(mop.mo_source, &mop); out: -- 1.8.3.1