Whamcloud - gitweb
LU-17753 llite: ll_getattr_dentry(): protect access to times 43/54843/5
authorVladimir Saveliev <vladimir.saveliev@hpe.com>
Mon, 13 May 2024 14:57:27 +0000 (17:57 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 16 Aug 2024 23:51:30 +0000 (23:51 +0000)
commitcd7c1407e35f2da2316a7ad67a3f7326694b6d4e
tree7193db7e6562513f128dadd7d00fd2cbf57219b0
parent8a865c65c691358c13bc7f564e952b605d74ea4b
LU-17753 llite: ll_getattr_dentry(): protect access to times

ll_merge_attr() updates inode's timestamps twice. Racing stat may get
intermediate values of timestamps.

Test to illustrate the issue is added.

ll_merge_attr() makes intermediate inode's timestamp update with
values from MDS under
ll_inode_info->lli_size_mutex. ll_getattr_dentry() should also use the
mutex to not return intermediate timestamps. This applies for regular
files only.

Test-Parameters: testlist=sanity env=ONLY=39u,ONLY_REPEAT=200
HPE-bug-id: LUS-12265
Signed-off-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Change-Id: Ic94040418da2a5cc5e41458dbf9d4c05244741ff
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54843
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_support.h
lustre/llite/file.c
lustre/tests/sanity.sh