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

Pull vfs fixes from Al Viro:
"Assorted fixes from the last week or so"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
VFS: collect_mounts() should return an ERR_PTR
bfs: iget_locked() doesn't return an ERR_PTR
efs: iget_locked() doesn't return an ERR_PTR()
proc: kill the extra proc_readfd_common()->dir_emit_dots()
cope with potentially long ->d_dname() output for shmem/hugetlb

Changed files
+17 -19
fs
bfs
efs
hugetlbfs
proc
include
linux
mm
+1 -1
fs/bfs/inode.c
··· 40 int block, off; 41 42 inode = iget_locked(sb, ino); 43 - if (IS_ERR(inode)) 44 return ERR_PTR(-ENOMEM); 45 if (!(inode->i_state & I_NEW)) 46 return inode;
··· 40 int block, off; 41 42 inode = iget_locked(sb, ino); 43 + if (!inode) 44 return ERR_PTR(-ENOMEM); 45 if (!(inode->i_state & I_NEW)) 46 return inode;
+11
fs/dcache.c
··· 2724 return memcpy(buffer, temp, sz); 2725 } 2726 2727 /* 2728 * Write full pathname from the root of the filesystem into the buffer. 2729 */
··· 2724 return memcpy(buffer, temp, sz); 2725 } 2726 2727 + char *simple_dname(struct dentry *dentry, char *buffer, int buflen) 2728 + { 2729 + char *end = buffer + buflen; 2730 + /* these dentries are never renamed, so d_lock is not needed */ 2731 + if (prepend(&end, &buflen, " (deleted)", 11) || 2732 + prepend_name(&end, &buflen, &dentry->d_name) || 2733 + prepend(&end, &buflen, "/", 1)) 2734 + end = ERR_PTR(-ENAMETOOLONG); 2735 + return end; 2736 + } 2737 + 2738 /* 2739 * Write full pathname from the root of the filesystem into the buffer. 2740 */
+1 -1
fs/efs/inode.c
··· 57 struct inode *inode; 58 59 inode = iget_locked(super, ino); 60 - if (IS_ERR(inode)) 61 return ERR_PTR(-ENOMEM); 62 if (!(inode->i_state & I_NEW)) 63 return inode;
··· 57 struct inode *inode; 58 59 inode = iget_locked(super, ino); 60 + if (!inode) 61 return ERR_PTR(-ENOMEM); 62 if (!(inode->i_state & I_NEW)) 63 return inode;
+1 -7
fs/hugetlbfs/inode.c
··· 926 return h - hstates; 927 } 928 929 - static char *hugetlb_dname(struct dentry *dentry, char *buffer, int buflen) 930 - { 931 - return dynamic_dname(dentry, buffer, buflen, "/%s (deleted)", 932 - dentry->d_name.name); 933 - } 934 - 935 static struct dentry_operations anon_ops = { 936 - .d_dname = hugetlb_dname 937 }; 938 939 /*
··· 926 return h - hstates; 927 } 928 929 static struct dentry_operations anon_ops = { 930 + .d_dname = simple_dname 931 }; 932 933 /*
+1 -1
fs/namespace.c
··· 1429 CL_COPY_ALL | CL_PRIVATE); 1430 namespace_unlock(); 1431 if (IS_ERR(tree)) 1432 - return NULL; 1433 return &tree->mnt; 1434 } 1435
··· 1429 CL_COPY_ALL | CL_PRIVATE); 1430 namespace_unlock(); 1431 if (IS_ERR(tree)) 1432 + return ERR_CAST(tree); 1433 return &tree->mnt; 1434 } 1435
-2
fs/proc/fd.c
··· 230 231 if (!dir_emit_dots(file, ctx)) 232 goto out; 233 - if (!dir_emit_dots(file, ctx)) 234 - goto out; 235 files = get_files_struct(p); 236 if (!files) 237 goto out;
··· 230 231 if (!dir_emit_dots(file, ctx)) 232 goto out; 233 files = get_files_struct(p); 234 if (!files) 235 goto out;
+1
include/linux/dcache.h
··· 336 * helper function for dentry_operations.d_dname() members 337 */ 338 extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); 339 340 extern char *__d_path(const struct path *, const struct path *, char *, int); 341 extern char *d_absolute_path(const struct path *, char *, int);
··· 336 * helper function for dentry_operations.d_dname() members 337 */ 338 extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); 339 + extern char *simple_dname(struct dentry *, char *, int); 340 341 extern char *__d_path(const struct path *, const struct path *, char *, int); 342 extern char *d_absolute_path(const struct path *, char *, int);
+1 -7
mm/shmem.c
··· 2909 2910 /* common code */ 2911 2912 - static char *shmem_dname(struct dentry *dentry, char *buffer, int buflen) 2913 - { 2914 - return dynamic_dname(dentry, buffer, buflen, "/%s (deleted)", 2915 - dentry->d_name.name); 2916 - } 2917 - 2918 static struct dentry_operations anon_ops = { 2919 - .d_dname = shmem_dname 2920 }; 2921 2922 /**
··· 2909 2910 /* common code */ 2911 2912 static struct dentry_operations anon_ops = { 2913 + .d_dname = simple_dname 2914 }; 2915 2916 /**