LU-16772 quota: access lqe_glbl_data only under mutex
Hold mutex to protect lqe_glbl_data against freeing in
qmt_lvbo_update, qmt_allock_lock_array and qmt_setup_id_desc.
This patch should help against below(LU-14434) and similar panics.
BUG: unable to handle kernel NULL pointer dereference at
0000000000000000
RIP: 0010:qmt_id_lock_cb+0x69/0x100 [lquota]
qmt_id_lock_cb+0x69/0x100 [lquota]
qmt_glimpse_lock.isra.19+0x27e/0xfb0 [lquota]
qmt_reba_thread+0x5da/0x9b0 [lquota]
kthread+0x112/0x130
ret_from_fork+0x35/0x40
It is the 2nd part of
50ff4d1da63e8. The latest patchset of
https://review.whamcloud.com/c/fs/lustre-release/+/50748/ has extra
changes, but occasionally has been landed without inspection.
So it's not simple porting from upstream.
Fixes:
50ff4d1da63 ("LU-16772 quota: protect lqe_glbl_data in qmt_site_recalc_cb")
Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: I5753ace94a739c6df70dd8ea3bde828e2b5ed812
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51368
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>