Re: [PATCH 9/9] rename(): avoid a deadlock in the case of parents having no common ancestor

From: Al Viro
Date: Fri Nov 24 2023 - 01:15:26 EST


On Thu, Nov 23, 2023 at 11:36:22AM +0100, Jan Kara wrote:

> It would look more natural to me if s_vfs_rename_mutex got dropped in the
> callers (lock_rename(), lock_rename_child()) which have acquired the lock
> instead of here. I agree it results in a bit more boiler plate code though.

finish_locking_two_parents(), perhaps? ;-)

Seriously, though - it starts with ->s_vfs_rename_mutex and ends with
the environment for vfs_rename() or with all locks dropped.