[lustre-devel] [PATCH 41/45] lustre: lmv: do not print MDTs that are inactive

James Simmons jsimmons at infradead.org
Mon May 25 15:08:18 PDT 2020

From: Andreas Dilger <adilger at whamcloud.com>

Have lmv return -EAGAIN instead of -ENODATA for unconfigured MDTs.
That avoids "lfs df -v" from printing a long list of invalid MDTs
when trying to get the target state for non-rotational devices.

Add test for "lfs df -v" printing nonrotational state, as well as
limiting the reported OST and MDT to configured devices.

WC-bug-id: https://jira.whamcloud.com/browse/LU-13427
Lustre-commit: 3728c2825aa27 ("LU-13427 lmv: do not print MDTs that are inactive")
Signed-off-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38165
Reviewed-by: Jian Yu <yujian at whamcloud.com>
Reviewed-by: Ben Evans <beevans at whamcloud.com>
Reviewed-by: Mike Pershin <mpershin at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
 fs/lustre/lmv/lmv_obd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/lustre/lmv/lmv_obd.c b/fs/lustre/lmv/lmv_obd.c
index bb60f64..4583cea 100644
--- a/fs/lustre/lmv/lmv_obd.c
+++ b/fs/lustre/lmv/lmv_obd.c
@@ -820,7 +820,10 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 			return -ENODEV;
 		tgt = lmv_tgt(lmv, index);
-		if (!tgt || !tgt->ltd_active)
+		if (!tgt)
+			return -EAGAIN;
+		if (!tgt->ltd_active)
 			return -ENODATA;
 		mdc_obd = class_exp2obd(tgt->ltd_exp);

More information about the lustre-devel mailing list