Whamcloud - gitweb
bz-13516
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index c5e410e..1386608 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-
 /* for O_DIRECTORY */
 #define _GNU_SOURCE
 
@@ -50,9 +49,8 @@
 #include <unistd.h>
 #endif
 
-#include <lnet/lnetctl.h>
-
 #include <liblustre.h>
+#include <lnet/lnetctl.h>
 #include <obd.h>
 #include <lustre_lib.h>
 #include <obd_lov.h>
@@ -134,7 +132,6 @@ int llapi_file_open(const char *name, int flags, int mode,
                 if (errno != EEXIST && errno != EALREADY)
                         errmsg = strerror(errno);
 
-                rc = -errno;
                 fprintf(stderr, "error on ioctl "LPX64" for '%s' (%d): %s\n",
                         (__u64)LL_IOC_LOV_SETSTRIPE, name, fd, errmsg);
         }
@@ -785,10 +782,12 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, void *data)
                 decision = -1;
 
         /* If a OST UUID is given, and some OST matches, check it here. */
-        if (decision != -1 && param->obdindex != OBD_NOT_FOUND &&
-            S_ISREG(st->st_mode)) {
-                /* Only those files should be accepted, which have a strip on
-                 * the specified OST. */
+        if (decision != -1 && param->obdindex != OBD_NOT_FOUND) {
+                if (!S_ISREG(st->st_mode))
+                        goto decided;
+
+                /* Only those files should be accepted, which have a
+                 * stripe on the specified OST. */
                 if (!param->lmd->lmd_lmm.lmm_stripe_count) {
                         decision = -1;
                 } else {
@@ -870,6 +869,7 @@ print_path:
                         printf("\n");
         }
 
+decided:
         /* Do not get down anymore? */
         if (param->depth == param->maxdepth)
                 return 1;