Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+5 -4
+4 -2
fs/inode.c
··· 1156 1156 */ 1157 1157 void lock_two_nondirectories(struct inode *inode1, struct inode *inode2) 1158 1158 { 1159 - WARN_ON_ONCE(S_ISDIR(inode1->i_mode)); 1160 - WARN_ON_ONCE(S_ISDIR(inode2->i_mode)); 1159 + if (inode1) 1160 + WARN_ON_ONCE(S_ISDIR(inode1->i_mode)); 1161 + if (inode2) 1162 + WARN_ON_ONCE(S_ISDIR(inode2->i_mode)); 1161 1163 lock_two_inodes(inode1, inode2, I_MUTEX_NORMAL, I_MUTEX_NONDIR2); 1162 1164 } 1163 1165 EXPORT_SYMBOL(lock_two_nondirectories);
+1 -2
fs/namei.c
··· 4874 4874 d_exchange(old_dentry, new_dentry); 4875 4875 } 4876 4876 out: 4877 - if (source) 4878 - inode_unlock(source); 4877 + inode_unlock(source); 4879 4878 if (target) 4880 4879 inode_unlock(target); 4881 4880 dput(new_dentry);