Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull filesystem fixes from Al Viro:
"Several bugfixes (all of them -stable fodder).

Alexey's one deals with double mutex_lock() in UFS (apparently, nobody
has tried to test "ufs: sb mutex merge + mutex_destroy" on something
like file creation/removal on ufs). Mine deal with two kinds of
umount bugs, in umount propagation and in handling of automounted
submounts, both resulting in bogus transient EBUSY from umount"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
ufs: fix deadlocks introduced by sb mutex merge
fix EBUSY on umount() from MNT_SHRINKABLE
get rid of propagate_umount() mistakenly treating slaves as busy.

Changed files
+18 -14
fs
+9 -1
fs/namespace.c
··· 1217 1217 head.first->pprev = &head.first; 1218 1218 INIT_HLIST_HEAD(&unmounted); 1219 1219 1220 + /* undo decrements we'd done in umount_tree() */ 1221 + hlist_for_each_entry(mnt, &head, mnt_hash) 1222 + if (mnt->mnt_ex_mountpoint.mnt) 1223 + mntget(mnt->mnt_ex_mountpoint.mnt); 1224 + 1220 1225 up_write(&namespace_sem); 1221 1226 1222 1227 synchronize_rcu(); ··· 1258 1253 hlist_add_head(&p->mnt_hash, &tmp_list); 1259 1254 } 1260 1255 1256 + hlist_for_each_entry(p, &tmp_list, mnt_hash) 1257 + list_del_init(&p->mnt_child); 1258 + 1261 1259 if (how) 1262 1260 propagate_umount(&tmp_list); 1263 1261 ··· 1271 1263 p->mnt_ns = NULL; 1272 1264 if (how < 2) 1273 1265 p->mnt.mnt_flags |= MNT_SYNC_UMOUNT; 1274 - list_del_init(&p->mnt_child); 1275 1266 if (mnt_has_parent(p)) { 1276 1267 put_mountpoint(p->mnt_mp); 1268 + mnt_add_count(p->mnt_parent, -1); 1277 1269 /* move the reference to mountpoint into ->mnt_ex_mountpoint */ 1278 1270 p->mnt_ex_mountpoint.dentry = p->mnt_mountpoint; 1279 1271 p->mnt_ex_mountpoint.mnt = &p->mnt_parent->mnt;
+1
fs/pnode.c
··· 381 381 * other children 382 382 */ 383 383 if (child && list_empty(&child->mnt_mounts)) { 384 + list_del_init(&child->mnt_child); 384 385 hlist_del_init_rcu(&child->mnt_hash); 385 386 hlist_add_before_rcu(&child->mnt_hash, &mnt->mnt_hash); 386 387 }
+2 -5
fs/ufs/inode.c
··· 902 902 invalidate_inode_buffers(inode); 903 903 clear_inode(inode); 904 904 905 - if (want_delete) { 906 - lock_ufs(inode->i_sb); 907 - ufs_free_inode (inode); 908 - unlock_ufs(inode->i_sb); 909 - } 905 + if (want_delete) 906 + ufs_free_inode(inode); 910 907 }
+6 -8
fs/ufs/namei.c
··· 126 126 if (l > sb->s_blocksize) 127 127 goto out_notlocked; 128 128 129 - lock_ufs(dir->i_sb); 130 129 inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); 131 130 err = PTR_ERR(inode); 132 131 if (IS_ERR(inode)) 133 - goto out; 132 + goto out_notlocked; 134 133 134 + lock_ufs(dir->i_sb); 135 135 if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) { 136 136 /* slow symlink */ 137 137 inode->i_op = &ufs_symlink_inode_operations; ··· 181 181 struct inode * inode; 182 182 int err; 183 183 184 - lock_ufs(dir->i_sb); 185 - inode_inc_link_count(dir); 186 - 187 184 inode = ufs_new_inode(dir, S_IFDIR|mode); 188 - err = PTR_ERR(inode); 189 185 if (IS_ERR(inode)) 190 - goto out_dir; 186 + return PTR_ERR(inode); 191 187 192 188 inode->i_op = &ufs_dir_inode_operations; 193 189 inode->i_fop = &ufs_dir_operations; 194 190 inode->i_mapping->a_ops = &ufs_aops; 195 191 196 192 inode_inc_link_count(inode); 193 + 194 + lock_ufs(dir->i_sb); 195 + inode_inc_link_count(dir); 197 196 198 197 err = ufs_make_empty(inode, dir); 199 198 if (err) ··· 211 212 inode_dec_link_count(inode); 212 213 inode_dec_link_count(inode); 213 214 iput (inode); 214 - out_dir: 215 215 inode_dec_link_count(dir); 216 216 unlock_ufs(dir->i_sb); 217 217 goto out;