From: Gregoire Pichon Date: Mon, 10 Sep 2012 13:27:26 +0000 (+0200) Subject: LU-1870 utils: correctly handle mount of multipath devices X-Git-Tag: 2.3.52~23 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=bc6011c431ffcfab0bc3066dd002deed1935b05b LU-1870 utils: correctly handle mount of multipath devices The mount.lustre command had lost the correct handling of multipath devices. When one is specified, an entry is added into /etc/mtab using the device name: /dev/mapper/mpathXX. This ensures unmount works fine with such devices. Signed-off-by: Gregoire Pichon Change-Id: I9060be882af944967a8c4b6b1c4403ea9250ad55 Reviewed-on: http://review.whamcloud.com/3922 Reviewed-by: Bob Glossman Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/utils/mount_lustre.c b/lustre/utils/mount_lustre.c index 325ae0f..042fac1 100644 --- a/lustre/utils/mount_lustre.c +++ b/lustre/utils/mount_lustre.c @@ -473,8 +473,6 @@ static int parse_opts(int argc, char *const argv[], struct mount_opts *mop) * symbolic link for instance */ if (realpath(mop->mo_usource, real_path) != NULL) { - mop->mo_usource = strdup(real_path); - ptr = strrchr(real_path, '/'); if (ptr && strncmp(ptr, "/dm-", 4) == 0 && isdigit(*(ptr + 4))) { snprintf(path, sizeof(path), "/sys/block/%s/dm/name", ptr+1); @@ -487,6 +485,7 @@ static int parse_opts(int argc, char *const argv[], struct mount_opts *mop) fclose(f); } } + mop->mo_usource = strdup(real_path); } ptr = strstr(mop->mo_usource, ":/");