Whamcloud - gitweb
LU-12378 ptlrpc: always reset generation for idle reconnect
[fs/lustre-release.git] / lustre / utils / lfs.c
index 079d2a0..6160ea4 100644 (file)
@@ -7000,8 +7000,16 @@ static int get_print_quota(char *mnt, char *name, struct if_quotactl *qctl,
                       "Some devices may be not working or deactivated. "
                       "The data in \"[]\" is inaccurate.\n");
 out:
-       return rc1;
+       if (rc1)
+               return rc1;
+       if (rc2)
+               return rc2;
+       if (rc3)
+               return rc3;
+       if (inacc)
+               return -EIO;
 
+       return 0;
 }
 
 static int lfs_project(int argc, char **argv)
@@ -8195,16 +8203,10 @@ static int fill_hur_item(struct hsm_user_request *hur, unsigned int idx,
        hui->hui_extent.length = -1;
 
        if (mntpath != NULL) {
-               if (*fname == '[')
-                       fname++;
-               rc = sscanf(fname, SFID, RFID(&hui->hui_fid));
-               if (rc == 3) {
-                       rc = 0;
-               } else {
+               rc = llapi_fid_parse(fname, &hui->hui_fid, NULL);
+               if (rc)
                        fprintf(stderr, "hsm: '%s' is not a valid FID\n",
                                fname);
-                       rc = -EINVAL;
-               }
        } else {
                rc = lfs_hsm_prepare_file(fname, &hui->hui_fid, last_dev);
        }
@@ -10712,6 +10714,11 @@ static int lfs_pcc_attach(int argc, char **argv)
                }
        }
 
+       if (archive_id == 0) {
+               fprintf(stderr, "%s: must specify attach ID\n", argv[0]);
+               return CMD_HELP;
+       }
+
        if (argc <= optind) {
                fprintf(stderr, "%s: must specify one or more file names\n",
                        argv[0]);