Skip to content
Snippets Groups Projects
Unverified Commit 2454ad83 authored by Jan Kara's avatar Jan Kara Committed by Christian Brauner
Browse files

fs: Restrict lock_two_nondirectories() to non-directory inodes


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>
parent 28eceeda
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment