Commit Graph

480860 Commits

Author SHA1 Message Date
Al Viro 78d28e651f kill f_dentry macro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:02:11 -05:00
Al Viro e63fa0d458 Merge branch 'for-lustre' into for-next 2014-11-19 13:01:59 -05:00
Mikulas Patocka 08d4f77222 dcache: fix kmemcheck warning in switch_names
This patch fixes kmemcheck warning in switch_names. The function
switch_names swaps inline names of two dentries. It swaps full arrays
d_iname, no matter how many bytes are really used by the strings. Reading
data beyond string ends results in kmemcheck warning.

We fix the bug by marking both arrays as fully initialized.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org # v3.15
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:26 -05:00
Al Viro 9f45f5bf30 new helper: audit_file()
... for situations when we don't have any candidate in pathnames - basically,
in descriptor-based syscalls.

[Folded the build fix for !CONFIG_AUDITSYSCALL configs from Chen Gang]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:26 -05:00
Al Viro 6f4e0d5aaa nfsd_vfs_write(): use file_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:26 -05:00
Al Viro a67f797db6 ncpfs: use file_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:25 -05:00
Al Viro b583043e99 kill f_dentry uses
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:25 -05:00
Al Viro 30e46aba8f lockd: get rid of ->f_path.dentry->d_sb
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:24 -05:00
Al Viro 3aa3377fbc procfs: get rid of ->f_dentry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:24 -05:00
Al Viro ef8a1a10e9 nfsd: get rid of ->f_dentry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:23 -05:00
Al Viro 32a59234ae rpc_pipefs.c: get rid of f_dentry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:23 -05:00
Al Viro 3c981bfc57 afs_fsync: don't bother with ->f_path.dentry
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:22 -05:00
Al Viro 7119e220a7 cifs: get rid of ->f_path.dentry->d_sb uses, add a new helper
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:22 -05:00
Al Viro ddb52f4fd2 btrfs: get rid of f_dentry use
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:21 -05:00
Al Viro 244c7d444b nfsd/nfsctl.c: new helper
... to get from opened file on nfsctl to relevant struct net *

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:21 -05:00
Al Viro a455589f18 assorted conversions to %p[dD]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:20 -05:00
Al Viro 41d28bca2d switch d_materialise_unique() users to d_splice_alias()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:20 -05:00
Al Viro b5ae6b15bd merge d_materialise_unique() into d_splice_alias()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:01:19 -05:00
Al Viro 154e80e4c3 Merge branch 'for-gfs2' into for-next 2014-11-19 13:00:57 -05:00
Al Viro 427c77d461 d_add_ci() should just accept a hashed exact match if it finds one
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 13:00:10 -05:00
Al Viro 845409b49b gfs2_atomic_open(): simplify the use of finish_no_open()
In ->atomic_open(inode, dentry, file, opened) calling finish_no_open(file, NULL)
is equivalent to dget(dentry); return finish_no_open(file, dentry);

No need to open-code that...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 12:57:21 -05:00
Al Viro 81295ce635 gfs2_create_inode(): don't bother with d_splice_alias()
dentry is always hashed and negative, inode - non-error, non-NULL and
non-directory.  In such conditions d_splice_alias() is equivalent to
"d_instantiate(dentry, inode) and return NULL", which simplifies the
downstream code and is consistent with the "have to create a new object"
case.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 12:57:21 -05:00
Al Viro 986cdb862e gfs2: bugger off early if O_CREAT open finds a directory
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-19 12:57:14 -05:00
Al Viro ca5358ef75 deal with deadlock in d_walk()
... by not hitting rename_retry for reasons other than rename having
happened.  In other words, do _not_ restart when finding that
between unlocking the child and locking the parent the former got
into __dentry_kill().  Skip the killed siblings instead...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:22:16 -05:00
Al Viro f76c23daac lustre: use is_root_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:19 -05:00
Al Viro fd5c6c36a2 lustre: get rid of duplicate mountpoint checks
VFS has already done them

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:18 -05:00
Al Viro 59cc93ef27 kill ll_link_generic()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:18 -05:00
Al Viro ea4df502dc ll_get_child_fid(): callers already have the child
no need to bother with d_lookup()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:17 -05:00
Al Viro 78851093c0 kill ll_rename_generic()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:17 -05:00
Al Viro 521f2ad7b6 kill ll_unlink_generic()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:16 -05:00
Al Viro 55dec6171f kill ll_rmdir_generic()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:16 -05:00
Al Viro b2037bb62b ll_new_inode(): don't bother with name - it's always &dentry->d_name
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:15 -05:00
Al Viro 60dd654e33 kill ll_symlink_generic()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:15 -05:00
Al Viro 7c2f909400 kill ll_mkdir_generic()
fold into ll_mkdir()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:14 -05:00
Al Viro d6689e5ffe kill ll_mknod_generic()
just fold into ll_mknod()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:14 -05:00
Al Viro e22fdcc8d7 lustre: switch ll_release_openhandle() to struct inode *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:13 -05:00
Al Viro 2a8a3597aa lustre: use file_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:13 -05:00
Al Viro 09561a53b5 lustre: use %p[dD]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:12 -05:00
Al Viro 74d01958a7 lustre: opened file can't have negative dentry
... and ll_md_close() gets inode already equal to file_inode(file),
along with ll_file_release()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:12 -05:00
Al Viro c139f3cef3 ll_setxattr(): get rid of struct file on stack
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:11 -05:00
Al Viro 48eddfd5ca lustre: switch ll_intent_file_open() to struct dentry *
... because fake struct file is wrong.

ll_prep_inode() in there is an atrocity - despite passing a pointer to
inode by address, it actually only uses the value when that value is
non-NULL, as it will be here.

Oh, and ->d_parent of anything is never NULL.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:21:11 -05:00
Al Viro 946e51f2bf move d_rcu from overlapping d_child to overlapping d_alias
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-11-03 15:20:29 -05:00
Al Viro a7400222e3 new helper: is_root_inode()
replace open-coded instances

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-31 17:48:54 -04:00
Miklos Szeredi ac7576f4b1 vfs: make first argument of dir_context.actor typed
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-31 17:48:54 -04:00
Miklos Szeredi 9f2f7d4c8d ovl: initialize ->is_cursor
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-31 17:47:51 -04:00
David Jeffery b2de525f09 Return short read or 0 at end of a raw device, not EIO
Author: David Jeffery <djeffery@redhat.com>
Changes to the basic direct I/O code have broken the raw driver when reading
to the end of a raw device.  Instead of returning a short read for a read that
extends partially beyond the device's end or 0 when at the end of the device,
these reads now return EIO.

The raw driver needs the same end of device handling as was added for normal
block devices.  Using blkdev_read_iter, which has the needed size checks,
prevents the EIO conditions at the end of the device.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-31 06:33:26 -04:00
Al Viro b0afd8e5db isofs: don't bother with ->d_op for normal case
we only need it for joliet and case-insensitive mounts

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-31 06:33:17 -04:00
Al Viro f643ff550a isofs_cmp(): we'll never see a dentry for . or ..
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-28 18:37:40 -04:00
Miklos Szeredi d1b72cc6d8 overlayfs: fix lockdep misannotation
In an overlay directory that shadows an empty lower directory, say
/mnt/a/empty102, do:

 	touch /mnt/a/empty102/x
 	unlink /mnt/a/empty102/x
 	rmdir /mnt/a/empty102

It's actually harmless, but needs another level of nesting between
I_MUTEX_CHILD and I_MUTEX_NORMAL.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-28 18:32:47 -04:00
Miklos Szeredi c2096537d4 ovl: fix check for cursor
ovl_cache_entry.name is now an array not a pointer, so it makes no sense
test for it being NULL.

Detected by coverity.

From: Miklos Szeredi <mszeredi@suse.cz>
Fixes: 68bf861107 ("overlayfs: make ovl_cache_entry->name an array instead of
+pointer")
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2014-10-28 18:31:54 -04:00