Whamcloud - gitweb
LU-16637 llite: call truncate_inode_pages() in inode lock
authorBobi Jam <bobijam@whamcloud.com>
Thu, 4 May 2023 02:39:29 +0000 (10:39 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 23 Jul 2023 01:24:38 +0000 (01:24 +0000)
commit1a084b1378ac37fb4269ac2e6dcac5c172fa00d2
tree505f0720833b5d4b2a7f6d55c9338fff8f523d50
parent1ef38b1258f1c6a26b24e1e1ff2b854b43db8f25
LU-16637 llite: call truncate_inode_pages() in inode lock

In some cases vvp_prune()->truncate_inode_pages() is get called
without IO context, we need protect it with inode lock as well.

So we add ll_inode_info::lli_inode_lock_owner and set it according to
vfs lock rules (Documentation/filesystems/Locking or
Documentation/filesystems/locking.rst), so before calling
truncate_inode_pages(), we'd lock the inode if it's not locked in
vfs.

Lustre-commit: 51d62f2122fee14fbb3ff8333b5a830e1181e4e5
Lustre-change: https://review.whamcloud.com/50857

Fixes: ef9be34478 ("LU-16637 llite: call truncate_inode_pages() under inode lock")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I84d7d999a49325810062a9a7337e184d35467820
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51643
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
16 files changed:
lustre/include/cl_object.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/llite_mmap.c
lustre/llite/llite_nfs.c
lustre/llite/namei.c
lustre/llite/pcc.c
lustre/llite/statahead.c
lustre/llite/vvp_io.c
lustre/llite/vvp_object.c
lustre/llite/xattr.c
lustre/llite/xattr_cache.c
lustre/lov/lov_object.c
lustre/obdclass/cl_object.c