mnt = argv[optind];
rc1 = llapi_quotactl(mnt, &qctl);
- if (rc1 < 0) {
- switch (rc1) {
- case -ESRCH:
- fprintf(stderr, "%s quotas are not enabled.\n",
- qctl.qc_type == USRQUOTA ? "user" : "group");
- goto out;
- case -EPERM:
- fprintf(stderr, "Permission denied.\n");
- case -ENOENT:
- /* We already got a "No such file..." message. */
- goto out;
- default:
- fprintf(stderr, "Unexpected quotactl error: %s\n",
- strerror(-rc1));
- }
- }
+ if (rc1 < 0) {
+ switch (rc1) {
+ case -ESRCH:
+ fprintf(stderr, "%s quotas are not enabled.\n",
+ qctl.qc_type == USRQUOTA ? "user" : "group");
+ goto out;
+ case -EPERM:
+ fprintf(stderr, "Permission denied.\n");
+ case -ENODEV:
+ case -ENOENT:
+ /* We already got error message. */
+ goto out;
+ default:
+ fprintf(stderr, "Unexpected quotactl error: %s\n",
+ strerror(-rc1));
+ }
+ }
if (qctl.qc_cmd == LUSTRE_Q_GETQUOTA && !quiet)
print_quota_title(name, &qctl, human_readable);
int llapi_quotactl(char *mnt, struct if_quotactl *qctl)
{
- DIR *root;
- int rc;
+ char fsname[PATH_MAX + 1];
+ DIR *root;
+ int rc;
+
+ rc = llapi_search_fsname(mnt, fsname);
+ if (rc) {
+ llapi_err_noerrno(LLAPI_MSG_ERROR,
+ "'%s' isn't on Lustre filesystem", mnt);
+ return rc;
+ }
root = opendir(mnt);
if (!root) {