Whamcloud - gitweb
LU-2008 utils: quote TUNE2FS options in ldiskfs_label_lustre
authorJian Yu <jian.yu@intel.com>
Wed, 17 Apr 2013 14:46:16 +0000 (22:46 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 31 May 2013 16:35:56 +0000 (12:35 -0400)
This patch improves ldiskfs_label_lustre() to quote the options
for TUNE2FS in case the label contains space(s).

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: I3eaeb604517dba29e07f9750aeb3afed9443e94f
Reviewed-on: http://review.whamcloud.com/6077
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/mount_utils_ldiskfs.c

index 53dab0c..45c491e 100644 (file)
@@ -1017,7 +1017,7 @@ int ldiskfs_label_lustre(struct mount_opts *mop)
        int rc;
 
        snprintf(label_cmd, sizeof(label_cmd),
-                TUNE2FS" -f -L %s %s >/dev/null 2>&1",
+                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));