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

Merge branch 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin

* 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin:
kernel: fix hlist_bl again
cgroups: Fix a lockdep warning at cgroup removal
fs: namei fix ->put_link on wrong inode in do_filp_open

+21 -20
+19 -18
fs/namei.c
··· 779 779 mntput(path->mnt); 780 780 } 781 781 782 - static inline void path_to_nameidata(struct path *path, struct nameidata *nd) 782 + static inline void path_to_nameidata(const struct path *path, 783 + struct nameidata *nd) 783 784 { 784 785 if (!(nd->flags & LOOKUP_RCU)) { 785 786 dput(nd->path.dentry); ··· 792 791 } 793 792 794 793 static __always_inline int 795 - __do_follow_link(struct path *path, struct nameidata *nd, void **p) 794 + __do_follow_link(const struct path *link, struct nameidata *nd, void **p) 796 795 { 797 796 int error; 798 - struct dentry *dentry = path->dentry; 797 + struct dentry *dentry = link->dentry; 799 798 800 - touch_atime(path->mnt, dentry); 799 + touch_atime(link->mnt, dentry); 801 800 nd_set_link(nd, NULL); 802 801 803 - if (path->mnt != nd->path.mnt) { 804 - path_to_nameidata(path, nd); 802 + if (link->mnt != nd->path.mnt) { 803 + path_to_nameidata(link, nd); 805 804 nd->inode = nd->path.dentry->d_inode; 806 805 dget(dentry); 807 806 } 808 - mntget(path->mnt); 807 + mntget(link->mnt); 809 808 810 809 nd->last_type = LAST_BIND; 811 810 *p = dentry->d_inode->i_op->follow_link(dentry, nd); ··· 2349 2348 nd.flags = flags; 2350 2349 filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); 2351 2350 while (unlikely(!filp)) { /* trailing symlink */ 2352 - struct path holder; 2351 + struct path link = path; 2352 + struct inode *linki = link.dentry->d_inode; 2353 2353 void *cookie; 2354 2354 error = -ELOOP; 2355 2355 /* S_ISDIR part is a temporary automount kludge */ 2356 - if (!(nd.flags & LOOKUP_FOLLOW) && !S_ISDIR(nd.inode->i_mode)) 2356 + if (!(nd.flags & LOOKUP_FOLLOW) && !S_ISDIR(linki->i_mode)) 2357 2357 goto exit_dput; 2358 2358 if (count++ == 32) 2359 2359 goto exit_dput; ··· 2370 2368 * just set LAST_BIND. 2371 2369 */ 2372 2370 nd.flags |= LOOKUP_PARENT; 2373 - error = security_inode_follow_link(path.dentry, &nd); 2371 + error = security_inode_follow_link(link.dentry, &nd); 2374 2372 if (error) 2375 2373 goto exit_dput; 2376 - error = __do_follow_link(&path, &nd, &cookie); 2374 + error = __do_follow_link(&link, &nd, &cookie); 2377 2375 if (unlikely(error)) { 2378 - if (!IS_ERR(cookie) && nd.inode->i_op->put_link) 2379 - nd.inode->i_op->put_link(path.dentry, &nd, cookie); 2376 + if (!IS_ERR(cookie) && linki->i_op->put_link) 2377 + linki->i_op->put_link(link.dentry, &nd, cookie); 2380 2378 /* nd.path had been dropped */ 2381 - nd.path = path; 2379 + nd.path = link; 2382 2380 goto out_path; 2383 2381 } 2384 - holder = path; 2385 2382 nd.flags &= ~LOOKUP_PARENT; 2386 2383 filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname); 2387 - if (nd.inode->i_op->put_link) 2388 - nd.inode->i_op->put_link(holder.dentry, &nd, cookie); 2389 - path_put(&holder); 2384 + if (linki->i_op->put_link) 2385 + linki->i_op->put_link(link.dentry, &nd, cookie); 2386 + path_put(&link); 2390 2387 } 2391 2388 out: 2392 2389 if (nd.root.mnt)
+1 -1
include/linux/list_bl.h
··· 16 16 * some fast and compact auxiliary data. 17 17 */ 18 18 19 - #if defined(CONFIG_SMP) 19 + #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) 20 20 #define LIST_BL_LOCKMASK 1UL 21 21 #else 22 22 #define LIST_BL_LOCKMASK 0UL
+1 -1
kernel/cgroup.c
··· 916 916 917 917 parent = dentry->d_parent; 918 918 spin_lock(&parent->d_lock); 919 - spin_lock(&dentry->d_lock); 919 + spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 920 920 list_del_init(&dentry->d_u.d_child); 921 921 spin_unlock(&dentry->d_lock); 922 922 spin_unlock(&parent->d_lock);