for root-owned files.
sanity/60a:
zfs before 80s, after 66s
ldiskfs before 65s, after 38s
ave.write declaration in sanity/60a:
zfs before 3.21 usec, after 1.16 usec
ldiskfs before 4.06 usec, after 0.66 usec
Change-Id: Ib9ba50d260eac408f1f5e43c4d722ff5024135cf
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/37232
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wangshilong1991@gmail.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
if (OBD_FAIL_CHECK(OBD_FAIL_OSD_TXN_START))
GOTO(out, rc = -EIO);
+ /*
+ * we ignore quota checks for system-owned files, but still
+ * need to count blocks for uid/gid/projid
+ */
+ osd_trans_declare_op(env, oh, OSD_OT_QUOTA, 3);
+
/*
* XXX temporary stuff. Some abstraction layer should
* be used.
th->th_ignore_quota;
ENTRY;
+ /* very fast path for special files like llog */
+ if (uid == 0 && gid == 0 && projid == 0)
+ return 0;
+
/* let's start with user quota */
qi->lqi_id.qid_uid = uid;
qi->lqi_type = USRQUOTA;
th->th_ignore_quota;
ENTRY;
+ /* very fast path for special files like llog */
+ if (uid == 0 && gid == 0 && projid == 0)
+ return 0;
+
if (osd_qid_declare_flags & OSD_QID_INODE)
qsd = osd->od_quota_slave_md;
else if (osd_qid_declare_flags & OSD_QID_BLK)
bool found = false;
ENTRY;
+ /* fast path, ignore quota enforcement request for root owned files */
+ if (qi->lqi_id.qid_uid == 0)
+ return 0;
+
if (unlikely(qsd == NULL))
RETURN(0);
* - quota isn't enforced for this quota type
* or - the user/group is root
* or - quota accounting isn't enabled */
- if (!qsd_type_enabled(qsd, qi->lqi_type) || qi->lqi_id.qid_uid == 0 ||
+ if (!qsd_type_enabled(qsd, qi->lqi_type) ||
(qsd->qsd_type_array[qi->lqi_type])->qqi_acct_failed)
RETURN(0);