diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-10-07 20:16:15 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-11-14 19:50:45 +0300 |
commit | 0ad9dfcb8d3fd6ef91983ccb93fafbf9e3115796 (patch) | |
tree | 1ad9831f401b4a34c1a46cab7da90d5eef8afde1 /fs/ntfs3/ntfs_fs.h | |
parent | ad26a9c84510af7252e582e811de970433a9758f (diff) | |
download | lwn-0ad9dfcb8d3fd6ef91983ccb93fafbf9e3115796.tar.gz lwn-0ad9dfcb8d3fd6ef91983ccb93fafbf9e3115796.zip |
fs/ntfs3: Changing locking in ntfs_rename
In some cases we can be in deadlock
because we tried to lock the same dir.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/ntfs_fs.h')
-rw-r--r-- | fs/ntfs3/ntfs_fs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 5269d4e66685..776993ae498b 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -334,6 +334,7 @@ enum ntfs_inode_mutex_lock_class { NTFS_INODE_MUTEX_REPARSE, NTFS_INODE_MUTEX_NORMAL, NTFS_INODE_MUTEX_PARENT, + NTFS_INODE_MUTEX_PARENT2, }; /* @@ -1121,6 +1122,11 @@ static inline void ni_lock_dir(struct ntfs_inode *ni) mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_PARENT); } +static inline void ni_lock_dir2(struct ntfs_inode *ni) +{ + mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_PARENT2); +} + static inline void ni_unlock(struct ntfs_inode *ni) { mutex_unlock(&ni->ni_lock); |