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 branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs fixes from Al Viro:
"A couple of fixes - deadlock in CIFS and build breakage in cris serial
driver (resurfaced f_dentry in there)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
VFS: Convert file->f_dentry->d_inode to file_inode()
fix deadlock in cifs_ioctl_clone()

+6 -17
+1 -1
arch/cris/arch-v32/drivers/sync_serial.c
··· 604 604 struct timespec *ts) 605 605 { 606 606 unsigned long flags; 607 - int dev = MINOR(file->f_dentry->d_inode->i_rdev); 607 + int dev = MINOR(file_inode(file)->i_rdev); 608 608 int avail; 609 609 struct sync_port *port; 610 610 unsigned char *start;
+5 -16
fs/cifs/ioctl.c
··· 86 86 } 87 87 88 88 src_inode = file_inode(src_file.file); 89 + rc = -EINVAL; 90 + if (S_ISDIR(src_inode->i_mode)) 91 + goto out_fput; 89 92 90 93 /* 91 94 * Note: cifs case is easier than btrfs since server responsible for 92 95 * checks for proper open modes and file type and if it wants 93 96 * server could even support copy of range where source = target 94 97 */ 95 - 96 - /* so we do not deadlock racing two ioctls on same files */ 97 - if (target_inode < src_inode) { 98 - mutex_lock_nested(&target_inode->i_mutex, I_MUTEX_PARENT); 99 - mutex_lock_nested(&src_inode->i_mutex, I_MUTEX_CHILD); 100 - } else { 101 - mutex_lock_nested(&src_inode->i_mutex, I_MUTEX_PARENT); 102 - mutex_lock_nested(&target_inode->i_mutex, I_MUTEX_CHILD); 103 - } 98 + lock_two_nondirectories(target_inode, src_inode); 104 99 105 100 /* determine range to clone */ 106 101 rc = -EINVAL; ··· 119 124 out_unlock: 120 125 /* although unlocking in the reverse order from locking is not 121 126 strictly necessary here it is a little cleaner to be consistent */ 122 - if (target_inode < src_inode) { 123 - mutex_unlock(&src_inode->i_mutex); 124 - mutex_unlock(&target_inode->i_mutex); 125 - } else { 126 - mutex_unlock(&target_inode->i_mutex); 127 - mutex_unlock(&src_inode->i_mutex); 128 - } 127 + unlock_two_nondirectories(src_inode, target_inode); 129 128 out_fput: 130 129 fdput(src_file); 131 130 out_drop_write: