• Jan Kara's avatar
    fs: Restrict lock_two_nondirectories() to non-directory inodes · 2454ad83
    Jan Kara authored
    Currently lock_two_nondirectories() is skipping any passed directories.
    After vfs_rename() uses lock_two_inodes(), all the remaining four users
    of this function pass only regular files to it. So drop the somewhat
    unusual "skip directory" logic and instead warn if anybody passes
    directory to it. This also allows us to use lock_two_inodes() in
    lock_two_nondirectories() to concentrate the lock ordering logic in less
    places.
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Message-Id: <20230601105830.13168-6-jack@suse.cz>
    Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
    2454ad83
inode.c 68.5 KB