return CMD_HELP;
}
- if (qctl.qc_cmd == LUSTRE_Q_GETQUOTA)
- print_quota_title(name, &qctl);
-
mnt = argv[optind];
version = llapi_server_major_version(mnt);
if (version < 0)
rc1 = llapi_quotactl(mnt, &qctl);
if (rc1 == -1) {
- if ((version >= SERVER_MAJOR_VERSION_V2 && errno == EALREADY) ||
- (version < SERVER_MAJOR_VERSION_V2 && errno == ESRCH)) {
- fprintf(stderr, "\n%s quotas are not enabled.\n",
- qctl.qc_type == USRQUOTA ? "user" : "group");
+ switch (errno) {
+ case EPERM:
+ fprintf(stderr, "Permission denied.\n");
+ case ENOENT:
+ /* We already got a "No such file..." message. */
goto out;
+ case EALREADY:
+ case ESRCH:
+ if ((version >= SERVER_MAJOR_VERSION_V2 &&
+ errno == EALREADY) ||
+ (version < SERVER_MAJOR_VERSION_V2 &&
+ errno == ESRCH)) {
+ fprintf(stderr, "%s quotas are not enabled.\n",
+ qctl.qc_type == USRQUOTA?"user":"group");
+ goto out;
+ }
+ default:
+ fprintf(stderr, "Unexpected quotactl error: %s\n",
+ strerror(errno));
}
}
+
+ if (qctl.qc_cmd == LUSTRE_Q_GETQUOTA)
+ print_quota_title(name, &qctl);
+
if (rc1 && *obd_type)
fprintf(stderr, "%s %s ", obd_type, obd_uuid);
if (pass == 1)
goto ug_output;
- return 0;
+ return rc1;
}
#endif /* HAVE_SYS_QUOTA_H! */