aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-11 14:44:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-11 14:44:11 -0400
commitf6f993328b2abcab86a3c99d7bd9f2066ab03d36 (patch)
treeea6f3902a0fa546493731b3b52a31d98cc747a90
parentc7a19c795b4b0a3232c157ed29eea85077e95da6 (diff)
parent12a5b5294cb1896e9a3c9fca8ff5a7e3def4e8c6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "Stuff in here: - acct.c fixes and general rework of mnt_pin mechanism. That allows to go for delayed-mntput stuff, which will permit mntput() on deep stack without worrying about stack overflows - fs shutdown will happen on shallow stack. IOW, we can do Eric's umount-on-rmdir series without introducing tons of stack overflows on new mntput() call chains it introduces. - Bruce's d_splice_alias() patches - more Miklos' rename() stuff. - a couple of regression fixes (stable fodder, in the end of branch) and a fix for API idiocy in iov_iter.c. There definitely will be another pile, maybe even two. I'd like to get Eric's series in this time, but even if we miss it, it'll go right in the beginning of for-next in the next cycle - the tricky part of prereqs is in this pile" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (40 commits) fix copy_tree() regression __generic_file_write_iter(): fix handling of sync error after DIO switch iov_iter_get_pages() to passing maximal number of pages fs: mark __d_obtain_alias static dcache: d_splice_alias should detect loops exportfs: update Exporting documentation dcache: d_find_alias needn't recheck IS_ROOT && DCACHE_DISCONNECTED dcache: remove unused d_find_alias parameter dcache: d_obtain_alias callers don't all want DISCONNECTED dcache: d_splice_alias should ignore DCACHE_DISCONNECTED dcache: d_splice_alias mustn't create directory aliases dcache: close d_move race in d_splice_alias dcache: move d_splice_alias namei: trivial fix to vfs_rename_dir comment VFS: allow ->d_manage() to declare -EISDIR in rcu_walk mode. cifs: support RENAME_NOREPLACE hostfs: support rename flags shmem: support RENAME_EXCHANGE shmem: support RENAME_NOREPLACE btrfs: add RENAME_NOREPLACE ...
-rw-r--r--Documentation/filesystems/nfs/Exporting38
-rw-r--r--Documentation/filesystems/vfs.txt3
-rw-r--r--fs/Makefile2
-rw-r--r--fs/bad_inode.c7
-rw-r--r--fs/btrfs/inode.c12
-rw-r--r--fs/btrfs/super.c9
-rw-r--r--fs/ceph/super.c2
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/cifs/cifsfs.h4
-rw-r--r--fs/cifs/inode.c14
-rw-r--r--fs/dcache.c196
-rw-r--r--fs/direct-io.c2
-rw-r--r--fs/ext4/namei.c1
-rw-r--r--fs/fs_pin.c78
-rw-r--r--fs/fuse/dir.c7
-rw-r--r--fs/fuse/file.c4
-rw-r--r--fs/hostfs/hostfs.h1
-rw-r--r--fs/hostfs/hostfs_kern.c30
-rw-r--r--fs/hostfs/hostfs_user.c28
-rw-r--r--fs/internal.h7
-rw-r--r--fs/mount.h2
-rw-r--r--fs/namei.c34
-rw-r--r--fs/namespace.c67
-rw-r--r--fs/nfs/getroot.c2
-rw-r--r--fs/nilfs2/super.c2
-rw-r--r--fs/super.c19
-rw-r--r--include/linux/acct.h4
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/fs_pin.h17
-rw-r--r--include/linux/mount.h4
-rw-r--r--include/linux/uio.h2
-rw-r--r--kernel/acct.c456
-rw-r--r--mm/filemap.c2
-rw-r--r--mm/iov_iter.c17
-rw-r--r--mm/shmem.c32
36 files changed, 645 insertions, 465 deletions
diff --git a/Documentation/filesystems/nfs/Exporting b/Documentation/filesystems/nfs/Exporting
index e543b1a619cc..c8f036a9b13f 100644
--- a/Documentation/filesystems/nfs/Exporting
+++ b/Documentation/filesystems/nfs/Exporting
@@ -66,23 +66,31 @@ b/ A per-superblock list "s_anon" of dentries which are the roots of
66 66
67c/ Helper routines to allocate anonymous dentries, and to help attach 67c/ Helper routines to allocate anonymous dentries, and to help attach
68 loose directory dentries at lookup time. They are: 68 loose directory dentries at lookup time. They are:
69 d_alloc_anon(inode) will return a dentry for the given inode. 69 d_obtain_alias(inode) will return a dentry for the given inode.
70 If the inode already has a dentry, one of those is returned. 70 If the inode already has a dentry, one of those is returned.
71 If it doesn't, a new anonymous (IS_ROOT and 71 If it doesn't, a new anonymous (IS_ROOT and
72 DCACHE_DISCONNECTED) dentry is allocated and attached. 72 DCACHE_DISCONNECTED) dentry is allocated and attached.
73 In the case of a directory, care is taken that only one dentry 73 In the case of a directory, care is taken that only one dentry
74 can ever be attached. 74 can ever be attached.
75 d_splice_alias(inode, dentry) will make sure that there is a 75 d_splice_alias(inode, dentry) or d_materialise_unique(dentry, inode)
76 dentry with the same name and parent as the given dentry, and 76 will introduce a new dentry into the tree; either the passed-in
77 which refers to the given inode. 77 dentry or a preexisting alias for the given inode (such as an
78 If the inode is a directory and already has a dentry, then that 78 anonymous one created by d_obtain_alias), if appropriate. The two
79 dentry is d_moved over the given dentry. 79 functions differ in their handling of directories with preexisting
80 If the passed dentry gets attached, care is taken that this is 80 aliases:
81 mutually exclusive to a d_alloc_anon operation. 81 d_splice_alias will use any existing IS_ROOT dentry, but it will
82 If the passed dentry is used, NULL is returned, else the used 82 return -EIO rather than try to move a dentry with a different
83 dentry is returned. This corresponds to the calling pattern of 83 parent. This is appropriate for local filesystems, which
84 ->lookup. 84 should never see such an alias unless the filesystem is
85 85 corrupted somehow (for example, if two on-disk directory
86 entries refer to the same directory.)
87 d_materialise_unique will attempt to move any dentry. This is
88 appropriate for distributed filesystems, where finding a
89 directory other than where we last cached it may be a normal
90 consequence of concurrent operations on other hosts.
91 Both functions return NULL when the passed-in dentry is used,
92 following the calling convention of ->lookup.
93
86 94
87Filesystem Issues 95Filesystem Issues
88----------------- 96-----------------
@@ -120,12 +128,12 @@ struct which has the following members:
120 128
121 fh_to_dentry (mandatory) 129 fh_to_dentry (mandatory)
122 Given a filehandle fragment, this should find the implied object and 130 Given a filehandle fragment, this should find the implied object and
123 create a dentry for it (possibly with d_alloc_anon). 131 create a dentry for it (possibly with d_obtain_alias).
124 132
125 fh_to_parent (optional but strongly recommended) 133 fh_to_parent (optional but strongly recommended)
126 Given a filehandle fragment, this should find the parent of the 134 Given a filehandle fragment, this should find the parent of the
127 implied object and create a dentry for it (possibly with d_alloc_anon). 135 implied object and create a dentry for it (possibly with
128 May fail if the filehandle fragment is too small. 136 d_obtain_alias). May fail if the filehandle fragment is too small.
129 137
130 get_parent (optional but strongly recommended) 138 get_parent (optional but strongly recommended)
131 When given a dentry for a directory, this should return a dentry for 139 When given a dentry for a directory, this should return a dentry for
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index a1d0d7a30165..61d65cc65c54 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -1053,7 +1053,8 @@ struct dentry_operations {
1053 If the 'rcu_walk' parameter is true, then the caller is doing a 1053 If the 'rcu_walk' parameter is true, then the caller is doing a
1054 pathwalk in RCU-walk mode. Sleeping is not permitted in this mode, 1054 pathwalk in RCU-walk mode. Sleeping is not permitted in this mode,
1055 and the caller can be asked to leave it and call again by returning 1055 and the caller can be asked to leave it and call again by returning
1056 -ECHILD. 1056 -ECHILD. -EISDIR may also be returned to tell pathwalk to
1057 ignore d_automount or any mounts.
1057 1058
1058 This function is only used if DCACHE_MANAGE_TRANSIT is set on the 1059 This function is only used if DCACHE_MANAGE_TRANSIT is set on the
1059 dentry being transited from. 1060 dentry being transited from.
diff --git a/fs/Makefile b/fs/Makefile
index 4030cbfbc9af..90c88529892b 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -11,7 +11,7 @@ obj-y := open.o read_write.o file_table.o super.o \
11 attr.o bad_inode.o file.o filesystems.o namespace.o \ 11 attr.o bad_inode.o file.o filesystems.o namespace.o \
12 seq_file.o xattr.o libfs.o fs-writeback.o \ 12 seq_file.o xattr.o libfs.o fs-writeback.o \
13 pnode.o splice.o sync.o utimes.o \ 13 pnode.o splice.o sync.o utimes.o \
14 stack.o fs_struct.o statfs.o 14 stack.o fs_struct.o statfs.o fs_pin.o
15 15
16ifeq ($(CONFIG_BLOCK),y) 16ifeq ($(CONFIG_BLOCK),y)
17obj-y += buffer.o block_dev.o direct-io.o mpage.o 17obj-y += buffer.o block_dev.o direct-io.o mpage.o
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 7c93953030fb..afd2b4408adf 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -218,8 +218,9 @@ static int bad_inode_mknod (struct inode *dir, struct dentry *dentry,
218 return -EIO; 218 return -EIO;
219} 219}
220 220
221static int bad_inode_rename (struct inode *old_dir, struct dentry *old_dentry, 221static int bad_inode_rename2(struct inode *old_dir, struct dentry *old_dentry,
222 struct inode *new_dir, struct dentry *new_dentry) 222 struct inode *new_dir, struct dentry *new_dentry,
223 unsigned int flags)
223{ 224{
224 return -EIO; 225 return -EIO;
225} 226}
@@ -279,7 +280,7 @@ static const struct inode_operations bad_inode_ops =
279 .mkdir = bad_inode_mkdir, 280 .mkdir = bad_inode_mkdir,
280 .rmdir = bad_inode_rmdir, 281 .rmdir = bad_inode_rmdir,
281 .mknod = bad_inode_mknod, 282 .mknod = bad_inode_mknod,
282 .rename = bad_inode_rename, 283 .rename2 = bad_inode_rename2,
283 .readlink = bad_inode_readlink, 284 .readlink = bad_inode_readlink,
284 /* follow_link must be no-op, otherwise unmounting this inode 285 /* follow_link must be no-op, otherwise unmounting this inode
285 won't work */ 286 won't work */
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 3668048e16f8..3183742d6f0d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8476,6 +8476,16 @@ out_notrans:
8476 return ret; 8476 return ret;
8477} 8477