LU-12193 quota: use rw_sem to protect lqs_hash
Patch introduces rw semaphore for locking
in cfs_hash_lock. It is used to protect lqs_hash
instead of rw_lock to avoid sleeping in atomic:
BUG: sleeping function called from invalid context at kernel/rwsem.c:51
in_atomic(): 1, irqs_disabled(): 0, pid: 11265, name: mdt00_004
CPU: 0 PID: 11265 Comm: mdt00_004 Kdump: loaded Tainted: P
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
[<
ffffffff817b5bf2>] dump_stack+0x19/0x1b
[<
ffffffff810c3bc9>] __might_sleep+0xd9/0x100
[<
ffffffff817bc470>] down_write+0x20/0x50
[<
ffffffffa0a7dad9>] qmt_set_with_lqe+0x3a9/0x750 [lquota]
[<
ffffffffa0a7dede>] qmt_entry_iter_cb+0x5e/0xa0 [lquota]
[<
ffffffffa01b327c>] cfs_hash_for_each_tight+0x10c/0x300 [libcfs]
[<
ffffffffa01b3503>] cfs_hash_for_each_safe+0x13/0x20 [libcfs]
[<
ffffffffa0a7db4f>] qmt_set_with_lqe+0x41f/0x750 [lquota]
[<
ffffffffa0a7dfa9>] qmt_set.constprop.15+0x89/0x2a0 [lquota]
[<
ffffffffa0a7e649>] qmt_quotactl+0x489/0x560 [lquota]
[<
ffffffffa0cc3a90>] mdt_quotactl+0x620/0x770 [mdt]
[<
ffffffffa06860f5>] tgt_request_handle+0x915/0x15c0 [ptlrpc]
[<
ffffffffa0628639>] ptlrpc_server_handle_request+0x259/0xad0 [ptlrpc]
[<
ffffffffa062c771>] ptlrpc_main+0xca1/0x2290 [ptlrpc]
[<
ffffffff810b4ed4>] kthread+0xe4/0xf0
[<
ffffffff817cac77>] ret_from_fork_nospec_begin+0x21/0x21
[ 280.258396] BUG: scheduling while atomic: mdt00_004/11265/0x10000003
Change-Id: Id9238f9001c38105fb91d29c47fa34ad35158b40
Signed-off-by: Sergey Cheremencev <c17829@cray.com>
Reviewed-on: https://review.whamcloud.com/36795
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>