Whamcloud - gitweb
LU-15283 quota: deadlock between reint & lquota_wb 67/45667/6
authorYang Sheng <ys@whamcloud.com>
Mon, 29 Nov 2021 15:00:03 +0000 (23:00 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 11 Jan 2022 06:18:59 +0000 (06:18 +0000)
commitd527e812461baf9db2f6ed960a3b6cc12d4ab37c
tree1a0a3336d0770a17b209e730aee5247de58eac8f
parent92fadf9cc1d06b21b482a262ff66f435814a13f8
LU-15283 quota: deadlock between reint & lquota_wb

The reintegration thread may be still running while
the lquota_wb thread process the update record. The
reint thread will hold the dynlock and start a
transaction, lquota_wb thread will start a transacation
then try to grab the dynlock. So we must avoid the
reint & writeback thread running in parallel. This
issue only occur on the ldiskfs case.

COMMAND: "qsd_reint_2.wor"
__schedule
schedule
wait_transaction_locked [jbd2]
add_transaction_credits [jbd2]
start_this_handle [jbd2]
jbd2__journal_start [jbd2]
__ldiskfs_journal_start_sb [ldiskfs]
ldiskfs_release_dquot [ldiskfs]
dqput
dquot_get_dqblk
osd_acct_index_lookup [osd_ldiskfs]
lquota_disk_read [lquota]
qsd_refresh_usage [lquota]
qsd_reconciliation [lquota]
qsd_reint_main [lquota]
kthread
ret_from_fork

COMMAND: "lquota_wb_work-"
__schedule
 schedule
 dynlock_lock [osd_ldiskfs]
 __iam_it_get [osd_ldiskfs]
 iam_it_get [osd_ldiskfs]
 osd_index_iam_lookup [osd_ldiskfs]
 lquota_disk_write [lquota]
 qsd_update_index [lquota]
 qsd_upd_thread [lquota]
 kthread
 ret_from_fork

Signed-off-by: Yang Sheng <ys@whamcloud.com>
Change-Id: I8cdd6227d3b0c5d4f67c432c3129da42a83c0ef2
Reviewed-on: https://review.whamcloud.com/45667
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_quota.h
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_handler.c
lustre/quota/qsd_internal.h
lustre/quota/qsd_lib.c
lustre/quota/qsd_reint.c
lustre/quota/qsd_writeback.c