Whamcloud - gitweb
LU-15880 quota: fix issues in reserving quota
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 12 Aug 2022 10:03:31 +0000 (18:03 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 18 Aug 2022 06:43:43 +0000 (06:43 +0000)
commit8e70d0bc71572536df779db328a13925d77d8539
tree429e9952d250664ef8f2492c80a6993440536881
parent01fc3166a83cd78ba2d7399b7beb8d40b58e2591
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.

Lustre-change: https://review.whamcloud.com/47425
Lustre-commit: 40daa59ac41f450b60b42eb2bb0ff42ebd3c998b

Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Change-Id: I098cde7d5e89fe8b9eaab0ae4bc285a4ac6c2281
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47944
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@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