Whamcloud - gitweb
LU-14535 quota: free lvbo in a wq 07/54107/6
authorSergey Cheremencev <scherementsev@ddn.com>
Sat, 20 Jan 2024 06:38:38 +0000 (14:38 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Mar 2024 05:55:16 +0000 (05:55 +0000)
commit2cc18ece1e50c760786a13a9dcb5857d7768cb0f
treea8fc43e3907f22011cd00bbe5b3d01e651261fa8
parent1231382e60e34fd4fe472170388d7675f6ff19fa
LU-14535 quota: free lvbo in a wq

Mutex lqe_glbl_data_lock holded in
qmt_lvbo_free might be the reason of
sleeping while atommic if
cfs_hash_for_each_relax is getting a
spinlock on an upper layer:

 BUG: sleeping function called from invalid
context at kernel/mutex.c:104
 ...
 Call Trace:
 dump_stack+0x19/0x1b
 __might_sleep+0xd9/0x100
 mutex_lock+0x20/0x40
 qmt_lvbo_free+0xc7/0x380 [lquota]
 mdt_lvbo_free+0x12d/0x140 [mdt]
 ldlm_resource_putref+0x189/0x250 [ptlrpc]
 ldlm_lock_put+0x1c8/0x760 [ptlrpc]
 ldlm_export_lock_put+0x12/0x20 [ptlrpc]
 cfs_hash_for_each_relax+0x3ff/0x450 [libcfs]
 cfs_hash_for_each_empty+0x9a/0x210 [libcfs]
 ldlm_export_cancel_locks+0xc2/0x1a0 [ptlrpc]
 ldlm_bl_thread_main+0x7c8/0xb00 [ptlrpc]
 kthread+0xe4/0xf0
 ret_from_fork_nospec_begin+0x7/0x21

Move freeing of lvbo to a workqueue. This
patch could be probably reverted as soon
as https://review.whamcloud.com/45882 will
be landed.

Fixes: 1dbcbd70f8 ("LU-15021 quota: protect lqe_glbl_data in lqe")
Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: I56aee72a7adbc6514b40689bae30669e607b5ecd
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54107
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/quota/lquota_internal.h
lustre/quota/qmt_dev.c
lustre/quota/qmt_entry.c
lustre/quota/qmt_internal.h
lustre/quota/qmt_lock.c