From: John L. Hammond Date: Thu, 20 Oct 2016 14:47:00 +0000 (-0500) Subject: LU-8723 llapi: correct open() handling in llapi_obd_statfs() X-Git-Tag: 2.8.60~5 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c791db551d022cd804e9dcc751cd7e33102a741a LU-8723 llapi: correct open() handling in llapi_obd_statfs() In llapi_obd_statfs() remove a spurious errno test and retry after open(). Signed-off-by: John L. Hammond Change-Id: I1667f1f0acf0e1f0d700049bc39a5e6c462b9df6 Reviewed-on: http://review.whamcloud.com/23285 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin --- diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 820d28d..07c24ba 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -3382,12 +3382,9 @@ int llapi_obd_statfs(char *path, __u32 type, __u32 index, return rc; } - fd = open(path, O_RDONLY); - if (errno == EISDIR) - fd = open(path, O_DIRECTORY | O_RDONLY); - + fd = open(path, O_RDONLY); if (fd < 0) { - rc = errno ? -errno : -EBADF; + rc = -errno; llapi_error(LLAPI_MSG_ERROR, rc, "error: %s: opening '%s'", __func__, path); /* If we can't even open a file on the filesystem (e.g. with