Whamcloud - gitweb
LU-2008 utils: make label method work with mmp enabled target
authorJian Yu <jian.yu@intel.com>
Wed, 3 Apr 2013 08:46:49 +0000 (16:46 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 8 Apr 2013 15:26:12 +0000 (11:26 -0400)
Commit cfef795 introduced label methods for ldiskfs and zfs to
make mount utility update the label after the first successful
mount. However, if the MMP feature was enabled on an ldiskfs
target before mounting, running mount utility on the target
will fail at ldiskfs_label_lustre() because MMP will prevent
e2label from setting the label.

This patch fixes the above issue by using "tune2fs -f -L" to force
setting the label instead of using e2label in ldiskfs_label_lustre().

Test-Parameters: envdefinitions=SLOW=yes \
clientcount=4 osscount=2 mdscount=2 \
austeroptions=-R failover=true useiscsi=true \
testlist=mmp

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I6af753d1d841da6493402c153a695eb07ee7ce5b
Reviewed-on: http://review.whamcloud.com/5867
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/mount_utils_ldiskfs.c

index b8efddc..a157a2a 100644 (file)
@@ -1016,8 +1016,9 @@ int ldiskfs_label_lustre(struct mount_opts *mop)
        char label_cmd[PATH_MAX];
        int rc;
 
-       snprintf(label_cmd, sizeof(label_cmd), E2LABEL" %s %s",
-                mop->mo_source, mop->mo_ldd.ldd_svname);
+       snprintf(label_cmd, sizeof(label_cmd),
+                TUNE2FS" -f -L %s %s >/dev/null 2>&1",
+                mop->mo_ldd.ldd_svname, mop->mo_source);
        rc = run_command(label_cmd, sizeof(label_cmd));
 
        return rc;