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-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
CacheFiles: Fix a race in cachefiles_delete_object() vs rename
vfs: don't call ima_file_check() unconditionally in nfsd_open()
fs: inode - remove 8 bytes of padding on 64bits allowing 1 more objects/slab under slub
Switch proc/self to nd_set_link()
fix LOOKUP_FOLLOW on automount "symlinks"

+45 -10
+11 -1
fs/cachefiles/namei.c
··· 348 348 dir = dget_parent(object->dentry); 349 349 350 350 mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); 351 - ret = cachefiles_bury_object(cache, dir, object->dentry); 351 + 352 + /* we need to check that our parent is _still_ our parent - it may have 353 + * been renamed */ 354 + if (dir == object->dentry->d_parent) { 355 + ret = cachefiles_bury_object(cache, dir, object->dentry); 356 + } else { 357 + /* it got moved, presumably by cachefilesd culling it, so it's 358 + * no longer in the key path and we can ignore it */ 359 + mutex_unlock(&dir->d_inode->i_mutex); 360 + ret = 0; 361 + } 352 362 353 363 dput(dir); 354 364 _leave(" = %d", ret);
+12 -2
fs/namei.c
··· 823 823 } 824 824 825 825 /* 826 + * This is a temporary kludge to deal with "automount" symlinks; proper 827 + * solution is to trigger them on follow_mount(), so that do_lookup() 828 + * would DTRT. To be killed before 2.6.34-final. 829 + */ 830 + static inline int follow_on_final(struct inode *inode, unsigned lookup_flags) 831 + { 832 + return inode && unlikely(inode->i_op->follow_link) && 833 + ((lookup_flags & LOOKUP_FOLLOW) || S_ISDIR(inode->i_mode)); 834 + } 835 + 836 + /* 826 837 * Name resolution. 827 838 * This is the basic name resolution function, turning a pathname into 828 839 * the final dentry. We expect 'base' to be positive and a directory. ··· 953 942 if (err) 954 943 break; 955 944 inode = next.dentry->d_inode; 956 - if ((lookup_flags & LOOKUP_FOLLOW) 957 - && inode && inode->i_op->follow_link) { 945 + if (follow_on_final(inode, lookup_flags)) { 958 946 err = do_follow_link(&next, nd); 959 947 if (err) 960 948 goto return_err;
+2 -1
fs/nfsd/vfs.c
··· 752 752 flags, current_cred()); 753 753 if (IS_ERR(*filp)) 754 754 host_err = PTR_ERR(*filp); 755 - host_err = ima_file_check(*filp, access); 755 + else 756 + host_err = ima_file_check(*filp, access); 756 757 out_nfserr: 757 758 err = nfserrno(host_err); 758 759 out:
+19 -5
fs/proc/base.c
··· 2369 2369 { 2370 2370 struct pid_namespace *ns = dentry->d_sb->s_fs_info; 2371 2371 pid_t tgid = task_tgid_nr_ns(current, ns); 2372 - char tmp[PROC_NUMBUF]; 2373 - if (!tgid) 2374 - return ERR_PTR(-ENOENT); 2375 - sprintf(tmp, "%d", task_tgid_nr_ns(current, ns)); 2376 - return ERR_PTR(vfs_follow_link(nd,tmp)); 2372 + char *name = ERR_PTR(-ENOENT); 2373 + if (tgid) { 2374 + name = __getname(); 2375 + if (!name) 2376 + name = ERR_PTR(-ENOMEM); 2377 + else 2378 + sprintf(name, "%d", tgid); 2379 + } 2380 + nd_set_link(nd, name); 2381 + return NULL; 2382 + } 2383 + 2384 + static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, 2385 + void *cookie) 2386 + { 2387 + char *s = nd_get_link(nd); 2388 + if (!IS_ERR(s)) 2389 + __putname(s); 2377 2390 } 2378 2391 2379 2392 static const struct inode_operations proc_self_inode_operations = { 2380 2393 .readlink = proc_self_readlink, 2381 2394 .follow_link = proc_self_follow_link, 2395 + .put_link = proc_self_put_link, 2382 2396 }; 2383 2397 2384 2398 /*
+1 -1
include/linux/fs.h
··· 729 729 uid_t i_uid; 730 730 gid_t i_gid; 731 731 dev_t i_rdev; 732 + unsigned int i_blkbits; 732 733 u64 i_version; 733 734 loff_t i_size; 734 735 #ifdef __NEED_I_SIZE_ORDERED ··· 739 738 struct timespec i_mtime; 740 739 struct timespec i_ctime; 741 740 blkcnt_t i_blocks; 742 - unsigned int i_blkbits; 743 741 unsigned short i_bytes; 744 742 umode_t i_mode; 745 743 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */