From: Hongchao Zhang Date: Fri, 24 Jun 2022 14:06:08 +0000 (+0800) Subject: LU-15880 quota: fix issues in reserving quota X-Git-Tag: 2.15.51~37 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=40daa59ac41f450b60b42eb2bb0ff42ebd3c998b;hp=40daa59ac41f450b60b42eb2bb0ff42ebd3c998b;p=fs%2Flustre-release.git 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 Change-Id: I098cde7d5e89fe8b9eaab0ae4bc285a4ac6c2281 Reviewed-on: https://review.whamcloud.com/47425 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Bobi Jam Reviewed-by: Sergey Cheremencev Reviewed-by: Oleg Drokin ---