Whamcloud - gitweb
LU-15880 quota: fix issues in reserving quota 25/47425/4
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 24 Jun 2022 14:06:08 +0000 (22:06 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Jul 2022 20:24:52 +0000 (20:24 +0000)
commit40daa59ac41f450b60b42eb2bb0ff42ebd3c998b
tree310e6df2621ca3b89bb6579b1fc4e36c1e4ffe3f
parenta7460d57fed7239d378e239cf837729dbdd2a21b
LU-15880 quota: fix issues in reserving quota

Calling "chgrp" with unprivileged user will reserve quota space
before changing the GID of the file, and the reserved quota space
will be freed after its transaction is committed. there are some
issues in the current implementation,
1, the reserved quota isn't freed in case of error in "mdd_attr_set"
   and "tgt_cb_last_committed".
2, during freeing the reserved quota, the quota space to free is
   set as the same parameter as reserving the quota, which could
   be wrong, for instance, the reserving quota space will be 0 if
   the corresponding quota ID isn't enforces, but the call will
   return without error.

Like the "qsd_op_begin/qsd_op_end",The patch also adds reference to
the lquota_entry gotten during reserving quota and release it during
freeing the reserved quota to prevent potential issue.

Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Change-Id: I098cde7d5e89fe8b9eaab0ae4bc285a4ac6c2281
Reviewed-on: https://review.whamcloud.com/47425
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/dt_object.h
lustre/include/lustre_quota.h
lustre/mdd/mdd_object.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_handler.c
lustre/quota/qsd_handler.c
lustre/target/tgt_lastrcvd.c