Whamcloud - gitweb
LU-7718 utils: lfs getstripe does not work on bind mount 95/18195/3
authorvinayakswami hariharmath <vinayakswami.hariharmath@seagate.com>
Thu, 28 Jan 2016 08:08:04 +0000 (13:38 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 14 Mar 2016 02:39:27 +0000 (02:39 +0000)
As /etc/mtab does not list original mount type and fsname
of bind mount point, using /prc/mounts to list out the
properties of the original mount point of bind mount.

Signed-off-by: vinayakswami hariharmath <vinayakswami.hariharmath@seagate.com>
Change-Id: Icf3644303552d56ad4e336decc5fadca581ff358
Reviewed-on: http://review.whamcloud.com/18195
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/liblustreapi.c
lustre/utils/lustreapi_internal.h

index 15ad55b..1ee277e 100644 (file)
@@ -855,11 +855,11 @@ int get_root_path(int want, char *fsname, int *outfd, char *path, int index)
         int rc = -ENODEV;
 
         /* get the mount point */
-        fp = setmntent(MOUNTED, "r");
+        fp = setmntent(PROC_MOUNTS, "r");
         if (fp == NULL) {
                 rc = -EIO;
                 llapi_error(LLAPI_MSG_ERROR, rc,
-                            "setmntent(%s) failed", MOUNTED);
+                            "setmntent(%s) failed", PROC_MOUNTS);
                 return rc;
         }
         while (1) {
index 2166c1e..deb77fc 100644 (file)
 #define WANT_FD     0x4
 #define WANT_INDEX  0x8
 #define WANT_ERROR  0x10
+
+/* mount point listings in /proc/mounts */
+#ifndef PROC_MOUNTS
+#define PROC_MOUNTS "/proc/mounts"
+#endif
+
 int get_root_path(int want, char *fsname, int *outfd, char *path, int index);
 int root_ioctl(const char *mdtname, int opc, void *data, int *mdtidxp,
               int want_error);