On client side, checking for owner/group quota can be directly
bypassed if this is for root and there is no root squash.
Change-Id: If29eca428d8748df412a717615e4d0a4886ddd04
Fixes:
a4fbe7341b ("LU-14739 quota: nodemap squashed root cannot bypass quota")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-on: https://review.whamcloud.com/45322
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
}
/* check if the file's owner/group is over quota */
}
/* check if the file's owner/group is over quota */
+ /* do not check for root without root squash, because in this case
+ * we should bypass quota
+ */
+ if ((!oio->oi_cap_sys_resource ||
+ cli->cl_root_squash) &&
+ !io->ci_noquota) {
struct cl_object *obj;
struct cl_attr *attr;
unsigned int qid[LL_MAXQUOTAS];
struct cl_object *obj;
struct cl_attr *attr;
unsigned int qid[LL_MAXQUOTAS];
qid[USRQUOTA] = attr->cat_uid;
qid[GRPQUOTA] = attr->cat_gid;
qid[PRJQUOTA] = attr->cat_projid;
qid[USRQUOTA] = attr->cat_uid;
qid[GRPQUOTA] = attr->cat_gid;
qid[PRJQUOTA] = attr->cat_projid;
- /*
- * if EDQUOT returned for root, we double check
- * if root squash enabled or not updated from server side.
- * without root squash, we should bypass quota for root.
- */
- if (rc == 0 && osc_quota_chkdq(cli, qid) == -EDQUOT) {
- if (oio->oi_cap_sys_resource &&
- !cli->cl_root_squash) {
- io->ci_noquota = 1;
- rc = 0;
- } else {
- rc = -EDQUOT;
- }
- }
+ if (rc == 0 && osc_quota_chkdq(cli, qid) == -EDQUOT)
+ rc = -EDQUOT;