Whamcloud - gitweb
LU-16341 quota: fix panic in qmt_site_recalc_cb
authorSergey Cheremencev <sergey.cheremencev@hpe.com>
Fri, 24 Jun 2022 20:38:29 +0000 (23:38 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 11 May 2023 00:32:24 +0000 (00:32 +0000)
commitd965d634153924db8eda20d2d8f633c16f717b87
tree3bef34115beafd0b3ab1ce8529360c5e5fec41cb
parentaec0b812ad38c0d334b1615d8cd5683d9385714c
LU-16341 quota: fix panic in qmt_site_recalc_cb

The panic occurred due to empty qit_lqes array after
qmt_pool_lqes_lookup_spec. Sometimes it is possible if
global lqe is not enforced. Return -ENOENT from
qmt_pool_lqes_lookup_spec if no lqes have been added.
It fixes following panic:
BUG: unable to handle kernel NULL pointer dereference at
00000000000000f8
...
RIP: 0010:qmt_site_recalc_cb+0x2ec/0x780 [lquota]
...
[ffffa5564118fda0] cfs_hash_for_each_tight at ffffffffc0c72c81
[libcfs]
[ffffa5564118fe08] qmt_pool_recalc at ffffffffc142dec7 [lquota]
[ffffa5564118ff10] kthread at ffffffffb45043a6
[ffffa5564118ff50] ret_from_fork at ffffffffb4e00255

Add test sanity-quota_14 that reproduces above panic
without the fix.

HPE-bug-id: LUS-11007
Change-Id: Ie51396269fae7ed84379bef5fc964cce789eba7c
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50793
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
lustre/quota/qmt_handler.c
lustre/quota/qmt_pool.c
lustre/tests/sanity-quota.sh