• Jan Kara's avatar
    fs: Lock moved directories · 28eceeda
    Jan Kara authored
    When a directory is moved to a different directory, some filesystems
    (udf, ext4, ocfs2, f2fs, and likely gfs2, reiserfs, and others) need to
    update their pointer to the parent and this must not race with other
    operations on the directory. Lock the directories when they are moved.
    Although not all filesystems need this locking, we perform it in
    vfs_rename() because getting the lock ordering right is really difficult
    and we don't want to expose these locking details to filesystems.
    
    CC: stable@vger.kernel.org
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Message-Id: <20230601105830.13168-5-jack@suse.cz>
    Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
    28eceeda
directory-locking.rst 6.49 KB