Whamcloud - gitweb
LU-16341 quota: fix panic in qmt_site_recalc_cb 18/55518/3
authorSergey Cheremencev <sergey.cheremencev@hpe.com>
Fri, 24 Jun 2022 20:38:29 +0000 (23:38 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 26 Jun 2024 18:49:09 +0000 (18:49 +0000)
commit08ef56e1049386e499b065b2fc26dc292a6bf757
treeeb5d0280bf26a89bc58d22330a05fe23b16dd9f9
parent55f82ea129035cd64832be11f24821fd5f1b80f9
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 NULL pointer dereference at 00000000000000f8
    ...
    RIP: 0010:qmt_site_recalc_cb+0x2ec/0x780 [lquota]
    ...
    cfs_hash_for_each_tight at ffffffffc0c72c81 [libcfs]
    qmt_pool_recalc at ffffffffc142dec7 [lquota]
    kthread at ffffffffb45043a6
    ret_from_fork at ffffffffb4e00255

Add test sanity-quota_14 that reproduces above panic without the fix,
but skip it for older MDS that do not have this fix.

Lustre-change: https://review.whamcloud.com/49241
Lustre-commit: dfe7d2dd2b0d4c0c08faa613f44d2ab1f74c7420

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-by: jsimmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55518
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qmt_handler.c
lustre/quota/qmt_pool.c
lustre/tests/sanity-quota.sh