Whamcloud - gitweb
LU-18776 mdt: prevent multiple data discard calls 02/58302/3
authorMikhail Pershin <mpershin@whamcloud.com>
Wed, 5 Mar 2025 14:47:37 +0000 (17:47 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Mar 2025 23:31:37 +0000 (23:31 +0000)
commit799b533c34f468b3d094bf10453307beed409214
tree6d67800e5f6a9e0944c9796bdf9de86b1cf64138
parent5b195e87aca9705b0f49c90bc06763951ba93ef7
LU-18776 mdt: prevent multiple data discard calls

The mdt_dom_discard_data() might be called multiple times
for the same object. That creates cyclical locks for no
reason and moreover their callbacks are executed in the
same thread recursively causing stack overflow

Patch introduces mdt_object flag mot_discard_done to
indicate that data discard was initiated once and no
need for another one.
Additionally patch don't allow to use the same thread
for lock callback if ldlm_is_ast_discard_data() is true

Fixes: 291ac6e692 ("LU-17078 ldlm: do not spin up thread for local cancels")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I7dc5d0da93a38e04267e007f5132ddb20788f18f
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58302
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/ldlm/ldlm_lock.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_io.c