From: vinayakswami hariharmath Date: Thu, 28 Jan 2016 08:08:04 +0000 (+0530) Subject: LU-7718 utils: lfs getstripe does not work on bind mount X-Git-Tag: 2.8.51~50 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7e41081c512afcb883582e9d9c24cd04e77d0b27 LU-7718 utils: lfs getstripe does not work on bind mount 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 Change-Id: Icf3644303552d56ad4e336decc5fadca581ff358 Reviewed-on: http://review.whamcloud.com/18195 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 15ad55b..1ee277e 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -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) { diff --git a/lustre/utils/lustreapi_internal.h b/lustre/utils/lustreapi_internal.h index 2166c1e..deb77fc 100644 --- a/lustre/utils/lustreapi_internal.h +++ b/lustre/utils/lustreapi_internal.h @@ -43,6 +43,12 @@ #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);