]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rpc_populate(): lift cleanup into callers
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 20 Feb 2024 04:32:22 +0000 (23:32 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 Jul 2025 02:44:55 +0000 (22:44 -0400)
commit8be22c49646e47452e74aa0b97ea50fb04c271ed
treed36df0f341440f0eb28048673b671e6617c927eb
parent3829b30e771bbfff62fbe7eff555e7a6e0d4b5cd
rpc_populate(): lift cleanup into callers

rpc_populate() is called either from fill_super (where we don't
need to remove any files on failure - rpc_kill_sb() will take
them all out anyway) or from rpc_mkdir_populate(), where we need
to remove the directory we'd been trying to populate along with
whatever we'd put into it before we failed.  Simpler to combine
that into simple_recursive_removal() there.

Note that rpc_pipe is overlocking directories quite a bit -
locked parent is no obstacle to finding a child in dcache, so
keeping it locked won't prevent userland observing a partially
built subtree.

All we need is to follow minimal VFS requirements; it's not
as if clients used directory locking for exclusion - tree
changes are serialized, but that's done on ->pipefs_sb_lock.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
net/sunrpc/rpc_pipe.c