]> git.ipfire.org Git - thirdparty/linux.git/commit
VFS/nfsd/cachefiles/ovl: introduce start_removing() and end_removing()
authorNeilBrown <neil@brown.name>
Thu, 13 Nov 2025 00:18:28 +0000 (11:18 +1100)
committerChristian Brauner <brauner@kernel.org>
Fri, 14 Nov 2025 12:15:56 +0000 (13:15 +0100)
commitbd6ede8a06e89ca5a94a8b51cea792705d1b8ca2
tree0b3d4cfbecbc7886a04e1cc2926b3a19209d155f
parent7ab96df840e60eb933abfe65fc5fe44e72f16dc0
VFS/nfsd/cachefiles/ovl: introduce start_removing() and end_removing()

start_removing() is similar to start_creating() but will only return a
positive dentry with the expectation that it will be removed.  This is
used by nfsd, cachefiles, and overlayfs.  They are changed to also use
end_removing() to terminate the action begun by start_removing().  This
is a simple alias for end_dirop().

Apart from changes to the error paths, as we no longer need to unlock on
a lookup error, an effect on callers is that they don't need to test if
the found dentry is positive or negative - they can be sure it is
positive.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20251113002050.676694-6-neilb@ownmail.net
Tested-by: syzbot@syzkaller.appspotmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/cachefiles/namei.c
fs/namei.c
fs/nfsd/nfs4recover.c
fs/nfsd/vfs.c
fs/overlayfs/dir.c
fs/overlayfs/overlayfs.h
include/linux/namei.h