Whamcloud - gitweb
LU-13817 quota: print error when pool is absent 05/39505/8
authorSergey Cheremencev <sergey.cheremencev@hpe.com>
Fri, 24 Jul 2020 10:20:17 +0000 (13:20 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 26 Nov 2020 09:26:00 +0000 (09:26 +0000)
Print error for "lfs quota --pool" and
"lfs setquota -o" if pool is absent.

HPE-bug-id: LUS-9112
Test-Parameters: trivial testlist=sanity-quota
Change-Id: I4c2aa41d8c6f27742e68dfdc78c9d9365c760237
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-on: https://review.whamcloud.com/39505
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/liblustreapi.c

index 44ac26c..43fd548 100644 (file)
@@ -5683,6 +5683,9 @@ int llapi_quotactl(char *mnt, struct if_quotactl *qctl)
        rc = ioctl(root, OBD_IOC_QUOTACTL, qctl);
        if (rc < 0)
                rc = -errno;
        rc = ioctl(root, OBD_IOC_QUOTACTL, qctl);
        if (rc < 0)
                rc = -errno;
+       if (rc == -ENOENT && LUSTRE_Q_CMD_IS_POOL(qctl->qc_cmd))
+               llapi_error(LLAPI_MSG_ERROR | LLAPI_MSG_NO_ERRNO, rc,
+                           "Cannot find pool '%s'", qctl->qc_poolname);
 
        close(root);
        return rc;
 
        close(root);
        return rc;