Whamcloud - gitweb
Branch b1_6
authorjohann <johann>
Wed, 2 Jan 2008 09:16:52 +0000 (09:16 +0000)
committerjohann <johann>
Wed, 2 Jan 2008 09:16:52 +0000 (09:16 +0000)
b=14036
i=johann
i=tianzy

attachment 14460 / fix error messages.

lustre/utils/lfs.c

index 8bb138e..a714ab7 100644 (file)
@@ -1249,6 +1249,11 @@ static int lfs_quotaoff(int argc, char **argv)
         mnt = argv[optind];
 
         rc = llapi_quotactl(mnt, &qctl);
+        if (rc == -1 && errno == ESRCH) {
+                fprintf(stderr, "\n%s quotas are not enabled.\n", 
+                        qctl.qc_type == 0x00 ? "user" : "group");
+                return 0;
+        }
         if (rc) {
                 if (*obd_type)
                         fprintf(stderr, "%s %s ", obd_type,
@@ -1820,6 +1825,11 @@ static int lfs_quota(int argc, char **argv)
         mnt = argv[optind];
 
         rc1 = llapi_quotactl(mnt, &qctl);
+        if (rc1 == -1 && errno == ESRCH) {
+                fprintf(stderr, "\n%s quotas are not enabled.\n", 
+                        qctl.qc_type == 0x00 ? "user" : "group");
+                return 0;
+        }
         if (rc1 && *obd_type)
                 fprintf(stderr, "%s %s ", obd_type, obd_uuid);