]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:02 +0000 (14:03 +0100)
commit30db8309b703a80b0e6afca1d0797635c96c5a87
treec4935d44ab2f9a22093853eeeb2380e3e11bf110
parente1cc8886b628c4ce2dedef4b41383bb2e3fef16f
fuse_ctl_add_conn(): fix nlink breakage in case of early failure

[ Upstream commit c460192aae197df1b4db1dca493c35ad529f1b64 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fuse/control.c