]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fuse_ctl_add_conn(): fix nlink breakage in case of early failure
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 26 Oct 2025 06:38:43 +0000 (02:38 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 16 Nov 2025 06:35:01 +0000 (01:35 -0500)
commitc460192aae197df1b4db1dca493c35ad529f1b64
tree72038a2f87af90062ddf08ce642c620451851df2
parente9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c
fuse_ctl_add_conn(): fix nlink breakage in case of early failure

fuse_ctl_remove_conn() used to decrement the link count of root
manually; that got subsumed by simple_recursive_removal(), but
in case when subdirectory creation has failed the latter won't
get called.

Just move the modification of parent's link count into
fuse_ctl_add_dentry() to keep the things simple.  Allows to
get rid of the nlink argument as well...

Fixes: fcaac5b42768 "fuse_ctl: use simple_recursive_removal()"
Acked-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fuse/control.c