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>
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;