[PATCH 07/28] lustre: lmv: try another MDT if statfs failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alexander Boyko <alexander.boyko@xxxxxxx>

With lazystatfs option statfs could fail if MDT0 is offline.
This leads to MPICH->IOR fail during FOFB tests. A client
could get statfs data from different MDT at DNE setup.

HPE-bug-id: LUS-10581
WC-bug-id: https://jira.whamcloud.com/browse/LU-15788
Lustre-commit: 57f3262baa7d89311 ("LU-15788 lmv: try another MDT if statfs failed")
Signed-off-by: Alexander Boyko <alexander.boyko@xxxxxxx>
Reviewed-on: https://review.whamcloud.com/47152
Reviewed-by: Andreas Dilger <adilger@xxxxxxxxxxxxx>
Reviewed-by: Alexander Zarochentsev <alexander.zarochentsev@xxxxxxx>
Reviewed-by: Oleg Drokin <green@xxxxxxxxxxxxx>
Signed-off-by: James Simmons <jsimmons@xxxxxxxxxxxxx>
---
 fs/lustre/lmv/lmv_obd.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/lustre/lmv/lmv_obd.c b/fs/lustre/lmv/lmv_obd.c
index d83ba41ff..3af7a53 100644
--- a/fs/lustre/lmv/lmv_obd.c
+++ b/fs/lustre/lmv/lmv_obd.c
@@ -1233,6 +1233,7 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
 	u32 i;
 	u32 idx;
 	int rc = 0;
+	int err = 0;
 
 	temp = kzalloc(sizeof(*temp), GFP_NOFS);
 	if (!temp)
@@ -1252,6 +1253,10 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
 		if (rc) {
 			CERROR("%s: can't stat MDS #%d: rc = %d\n",
 			       tgt->ltd_exp->exp_obd->obd_name, i, rc);
+			err = rc;
+			/* Try another MDT */
+			if (flags & OBD_STATFS_SUM)
+				continue;
 			goto out_free_temp;
 		}
 
@@ -1266,7 +1271,7 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
 			 * service
 			 */
 			*osfs = *temp;
-			break;
+			goto out_free_temp;
 		}
 
 		if (i == 0) {
@@ -1279,7 +1284,9 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
 			osfs->os_granted += temp->os_granted;
 		}
 	}
-
+	/* There is no stats from some MDTs, data incomplete */
+	if (err)
+		rc = err;
 out_free_temp:
 	kfree(temp);
 	return rc;
-- 
1.8.3.1




[Index of Archives]     [linux Cryptography]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]

  Powered by Linux