mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
Merge tag 'v6.5/vfs.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull vfs fixes from Christian Brauner: "This contains two minor fixes for Jan's rename locking work: - Unlocking the source inode was guarded by a check whether source was non-NULL. This doesn't make sense because source must be non-NULL and the commit message explains in detail why - The lock_two_nondirectories() helper called WARN_ON_ONCE() and dereferenced the inodes unconditionally but the underlying lock_two_inodes() helper and the kernel documentation for that function are clear that it is valid to pass NULL arguments, so a non-NULL check is needed. No callers currently pass NULL arguments but let's not knowingly leave landmines around" * tag 'v6.5/vfs.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: fs: don't assume arguments are non-NULL fs: no need to check source
This commit is contained in:
@@ -1156,8 +1156,10 @@ lock:
|
||||
*/
|
||||
void lock_two_nondirectories(struct inode *inode1, struct inode *inode2)
|
||||
{
|
||||
WARN_ON_ONCE(S_ISDIR(inode1->i_mode));
|
||||
WARN_ON_ONCE(S_ISDIR(inode2->i_mode));
|
||||
if (inode1)
|
||||
WARN_ON_ONCE(S_ISDIR(inode1->i_mode));
|
||||
if (inode2)
|
||||
WARN_ON_ONCE(S_ISDIR(inode2->i_mode));
|
||||
lock_two_inodes(inode1, inode2, I_MUTEX_NORMAL, I_MUTEX_NONDIR2);
|
||||
}
|
||||
EXPORT_SYMBOL(lock_two_nondirectories);
|
||||
|
@@ -4874,8 +4874,7 @@ int vfs_rename(struct renamedata *rd)
|
||||
d_exchange(old_dentry, new_dentry);
|
||||
}
|
||||
out:
|
||||
if (source)
|
||||
inode_unlock(source);
|
||||
inode_unlock(source);
|
||||
if (target)
|
||||
inode_unlock(target);
|
||||
dput(new_dentry);
|
||||
|
Reference in New Issue
Block a user