Whamcloud - gitweb
LU-1870 utils: correctly handle mount of multipath devices
authorGregoire Pichon <gregoire.pichon@bull.net>
Mon, 10 Sep 2012 13:27:26 +0000 (15:27 +0200)
committerOleg Drokin <green@whamcloud.com>
Tue, 2 Oct 2012 04:06:57 +0000 (00:06 -0400)
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 <gregoire.pichon@bull.net>
Change-Id: I9060be882af944967a8c4b6b1c4403ea9250ad55
Reviewed-on: http://review.whamcloud.com/3922
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/utils/mount_lustre.c

index 325ae0f..042fac1 100644 (file)
@@ -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, ":/");