Whamcloud - gitweb
LU-16770 llite: prune object without layout lock first 87/56987/3
authorAndriy Skulysh <andriy.skulysh@hpe.com>
Tue, 12 Nov 2024 20:03:42 +0000 (12:03 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 22 Jan 2025 18:51:05 +0000 (18:51 +0000)
commitec54a4bbe37d4cf507a5c13466627d21d85c5f55
tree240f2728f760eb83e5775805b8b95d01e3c4896c
parent9287b2c34d3c7c4d94d9db3a5a622d89be31ec6b
LU-16770 llite: prune object without layout lock first

lov_layout_change() calls cl_object_prune() before
changing layout. It may lead to eviction from MDT
in case slow responce from OST.

To reduce risk of possible eviction call cl_object_prune()
without layout lock held before calling lov_layout_change()

vvp_prune() attempts to sync and truncate page cache pages.
osc_page_delete() may encounter page cache pages in non-clean state
during truncate because there's a race window between sync and truncate.
Writes may stick into this window and generate dirty or writeback pages.

This window is usually protected with a special truncate semaphore e.g.
when truncate is requested from the truncate syscall.

Let's use this semaphore to avoid write vs truncate race in vvp_prune().

Lustre-change: https://review.whamcloud.com/50742
Lustre-commit: 9c453ba6d9a0152aa75e92b8372d54a758a10b18

HPE-bug-id: LUS-9927, LUS-11612
Signed-off-by: Andriy Skulysh <andriy.skulysh@hpe.com>
Change-Id: Ie2ee29ea1e792e1b34b6de068ff2b84fd8f52f2a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56987
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Zhenyu Xu <bobijam@hotmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/cl_object.h
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/lov/lov_object.c