Whamcloud - gitweb
LU-15081 vfs: set_nlink() is not race-safe
authorAndrew Perepechko <andrew.perepechko@hpe.com>
Mon, 11 Oct 2021 19:11:05 +0000 (22:11 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 24 Dec 2022 01:23:41 +0000 (01:23 +0000)
commiteeb4d63f3bb5676484b2469a90038659facf7e13
tree6b818a1728a4ba550d2f3f000dc0e283f5733e32
parent8b572c4de0243d64769c61b272e8f62a105407ae
LU-15081 vfs: set_nlink() is not race-safe

set_nlink() is not atomic wrt race with itself and
the following warning may be triggered by VFS:

WARNING: CPU: 5 PID: 195090 at fs/inode.c:241 __destroy_inode+0xdb/0xf0

It does not seem important what exact nlink value is the result
of the race. However, we need to protect the superblock remove
counter.

Lustre-change: https://review.whamcloud.com/45191
Lustre-commit: 12b05772fdb6d080819b6c213fcd7f8705278412

Signed-off-by: Andrew Perepechko <andrew.perepechko@hpe.com>
HPE-bug-id: LUS-9825
Change-Id: I67bc345b9a9e43fb88d919a83246759d11604b03
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/49452
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/namei.c
lustre/lmv/lmv_intent.c