From e355279089f36c068ad5e63b155ac5f1820f88cb Mon Sep 17 00:00:00 2001 From: Vladimir Saveliev Date: Thu, 9 Dec 2010 23:09:39 +0300 Subject: [PATCH] b=24175 avoid reporting 'No such file or directory' error i=rahul.deshmukh --- lustre/utils/liblustreapi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 4f46c54..7f2e769 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -2834,6 +2834,10 @@ static int root_ioctl(const char *mdtname, int opc, void *data, int *mdtidxp, *mdtidxp = index; rc = ioctl(fd, opc, data); + if (rc == -1) + rc = -errno; + else + rc = 0; if (rc && want_error) llapi_err(LLAPI_MSG_ERROR, "ioctl %d err %d", opc, rc); @@ -3053,7 +3057,8 @@ int llapi_fid2path(const char *device, const char *fidstr, char *buf, /* Take path or fsname */ rc = root_ioctl(device, OBD_IOC_FID2PATH, gf, NULL, 0); if (rc) { - llapi_err(LLAPI_MSG_ERROR, "ioctl err %d", rc); + if (rc != -ENOENT) + llapi_err(LLAPI_MSG_ERROR, "ioctl err %d", rc); } else { memcpy(buf, gf->gf_path, gf->gf_pathlen); *recno = gf->gf_recno; -- 1.8.3.1