Whamcloud - gitweb
b=24175 avoid reporting 'No such file or directory' error
authorVladimir Saveliev <vladimir.saveliev@sun.com>
Thu, 9 Dec 2010 20:09:39 +0000 (23:09 +0300)
committerVitaly Fertman <vitaly.fertman@oracle.com>
Wed, 15 Dec 2010 02:25:02 +0000 (05:25 +0300)
i=rahul.deshmukh

lustre/utils/liblustreapi.c

index 4f46c54..7f2e769 100644 (file)
@@ -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;