summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cache the value of file_inode() in struct fileAl Viro2013-03-013-2/+6
| | | | | | | Note that this thing does *not* contribute to inode refcount; it's pinned down by dentry. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 9p: if v9fs_fid_lookup() gets to asking server, it'd better have hashed dentryAl Viro2013-02-281-3/+17
| | | | | | | ... otherwise the path we'd built isn't worth much. Don't accept such fids obtained from paths unless dentry is still alived by the end of the work. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 9p: make sure ->lookup() adds fid to the right dentryAl Viro2013-02-281-2/+5
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 9p: untangle ->lookup() a bitAl Viro2013-02-281-18/+9
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 9p: double iput() in ->lookup() if d_materialise_unique() failsAl Viro2013-02-281-1/+0
| | | | | | d_materialise_unique() does iput() itself. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 9p: v9fs_fid_add() can't fail nowAl Viro2013-02-284-22/+11
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* v9fs: get rid of v9fs_dentryAl Viro2013-02-283-51/+9
| | | | | | ->d_fsdata can act as hlist_head... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 9p: turn fid->dlist into hlistAl Viro2013-02-274-11/+9
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* 9p: don't bother with private lock in ->d_fsdata; dentry->d_lock will do ↵Al Viro2013-02-272-7/+6
| | | | | | just fine Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* more file_inode() open-coded instancesAl Viro2013-02-2710-45/+38
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* selinux: opened file can't have NULL or negative ->f_path.dentryAl Viro2013-02-271-9/+0
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* Merge branch 'for-linus' of ↵Linus Torvalds2013-02-26383-1423/+1276
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
| * saner proc_get_inode() calling conventionsAl Viro2013-02-262-21/+10
| | | | | | | | | | | | | | | | | | Make it drop the pde in *all* cases when no new reference to it is put into an inode - both when an inode had already been set up (as we were already doing) and when inode allocation has failed. Makes for simpler logics in callers... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * proc: avoid extra pde_put() in proc_fill_super()Maxim Patlasov2013-02-261-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | If proc_get_inode() succeeded, but d_make_root() failed, pde_put() for proc_root will be called twice: the first time due to iput() called from d_make_root() and the second time directly in the end of proc_fill_super(). Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * fs: change return values from -EACCES to -EPERMZhao Hongjiang2013-02-266-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to SUSv3: [EACCES] Permission denied. An attempt was made to access a file in a way forbidden by its file access permissions. [EPERM] Operation not permitted. An attempt was made to perform an operation limited to processes with appropriate privileges or to the owner of a file or other resource. So -EPERM should be returned if capability checks fails. Strictly speaking this is an API change since the error code user sees is altered. Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com> Acked-by: Jan Kara <jack@suse.cz> Acked-by: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Ian Kent <raven@themaw.net> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * fs/exec.c: make bprm_mm_init() staticYuanhan Liu2013-02-262-2/+1
| | | | | | | | | | | | | | | | There is only one user of bprm_mm_init, and it's inside the same file. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ocfs2/dlm: use GFP_ATOMIC inside a spin_lockDan Carpenter2013-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | My static checker complains that this is called with a spin_lock held in dlm_master_requery_handler() from dlmrecovery.c. Probably the reason we have not received any bug reports about this is that recovery is not a common operation. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Joel Becker <jlbec@evilplan.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ocfs2: fix possible use-after-free with AIOJan Kara2013-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running AIO is pinning inode in memory using file reference. Once AIO is completed using aio_complete(), file reference is put and inode can be freed from memory. So we have to be sure that calling aio_complete() is the last thing we do with the inode. Signed-off-by: Jan Kara <jack@suse.cz> Acked-by: Jeff Moyer <jmoyer@redhat.com> Acked-by: Joel Becker <jlbec@evilplan.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code pathSunil Mushran2013-02-261-1/+1
| | | | | | | | | | | | | | | | | | Commit ea022dfb3c2a4680483b00eb2fecc9fc4f6091d1 was missing a var init. Reported-and-Tested-by: Vincent Etienne <vetienne@aprogsys.com> Signed-off-by: Sunil Mushran <sunil.mushran@gmail.com> Signed-off-by: Joel Becker <jlbec@evilplan.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zeroAl Viro2013-02-263-4/+0
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * target: writev() on single-element vector is pointlessAl Viro2013-02-262-45/+17
| | | | | | | | | | | | | | | | | | | | ... in other news: filp_open() can't return a struct file with NULL dentry filp_open() can't return a struct file negative dentry filp_close() of something that never had been in any descriptor tables is pointless - fput() is all you need Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * export kernel_write(), convert open-coded instancesAl Viro2013-02-265-61/+24
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * fs: encode_fh: return FILEID_INVALID if invalid fid_typeNamjae Jeon2013-02-2612-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a follow up on below patch: [PATCH] exportfs: add FILEID_INVALID to indicate invalid fid_type commit: 216b6cbdcbd86b1db0754d58886b466ae31f5a63 Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Vivek Trivedi <t.vivek@samsung.com> Acked-by: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Sage Weil <sage@inktank.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * kill f_vfsmntAl Viro2013-02-265-6/+5
| | | | | | | | | | | | very few users left... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry opJeff Layton2013-02-2612-16/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following set of operations on a NFS client and server will cause server# mkdir a client# cd a server# mv a a.bak client# sleep 30 # (or whatever the dir attrcache timeout is) client# stat . stat: cannot stat `.': Stale NFS file handle Obviously, we should not be getting an ESTALE error back there since the inode still exists on the server. The problem is that the lookup code will call d_revalidate on the dentry that "." refers to, because NFS has FS_REVAL_DOT set. nfs_lookup_revalidate will see that the parent directory has changed and will try to reverify the dentry by redoing a LOOKUP. That of course fails, so the lookup code returns ESTALE. The problem here is that d_revalidate is really a bad fit for this case. What we really want to know at this point is whether the inode is still good or not, but we don't really care what name it goes by or whether the dcache is still valid. Add a new d_op->d_weak_revalidate operation and have complete_walk call that instead of d_revalidate. The intent there is to allow for a "weaker" d_revalidate that just checks to see whether the inode is still good. This is also gives us an opportunity to kill off the FS_REVAL_DOT special casing. [AV: changed method name, added note in porting, fixed confusion re having it possibly called from RCU mode (it won't be)] Cc: NeilBrown <neilb@suse.de> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * nfsd: handle vfs_getattr errors in acl protocolJ. Bruce Fields2013-02-264-9/+24
| | | | | | | | | | | | | | | | | | | | | | We're currently ignoring errors from vfs_getattr. The correct thing to do is to do the stat in the main service procedure not in the response encoding. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * switch vfs_getattr() to struct pathAl Viro2013-02-2614-35/+40
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * default SET_PERSONALITY() in linux/elf.hAl Viro2013-02-2617-54/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * ceph: prepopulate inodes only when request is abortedSage Weil2013-02-261-2/+38
| | | | | | | | | | | | | | | | | | | | If r_aborted is true, we do not hold the dir i_mutex, and cannot touch the dcache. However, we still need to update the inodes with the state returned by the MDS. Reported-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sage Weil <sage@inktank.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * d_hash_and_lookup(): export, switch open-coded instancesAl Viro2013-02-264-24/+18
| | | | | | | | | | | | | | | | * calling conventions change - ERR_PTR() is returned on ->d_hash() errors; NULL is just for dcache miss now. * exported, open-coded instances in ncpfs and cifs converted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate()Al Viro2013-02-263-35/+33
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * 9p: split dropping the acls from v9fs_set_create_acl()Al Viro2013-02-263-21/+28
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * 9p: switch v9fs_acl_chmod() from dentry to inode+fidAl Viro2013-02-263-16/+13
| | | | | | | | | | | | caller has both, might as well pass them explicitly. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * 9p: switch v9fs_set_acl() from dentry to fidAl Viro2013-02-261-5/+12
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * 9p: lift the call of set_cached_acl() into the callers of v9fs_set_acl()Al Viro2013-02-261-4/+3
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * 9p: add fid-based variant of v9fs_xattr_set()Al Viro2013-02-262-15/+20
| | | | | | | | | | | | ... making v9fs_xattr_set() a wrapper for it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * tegra: don't wank with d_find_alias()Al Viro2013-02-261-9/+3
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * lirc: get rid of bogus checksAl Viro2013-02-261-10/+1
| | | | | | | | | | | | | | | | file argument is a struct file being passed to ->open() or already opened; none of the checks in lirc_get_pdata() can fail. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * hugetlb_file_setup(): use d_alloc_pseudo()Al Viro2013-02-261-4/+15
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * shmem_setup_file(): use d_alloc_pseudo() instead of d_alloc()Al Viro2013-02-261-4/+15
| | | | | | | | | | | | | | | | | | Note that provided ->d_dname() reproduces what we used to get for those guys in e.g. /proc/self/maps; it might be a good idea to change that to something less ugly, but for now let's keep the existing user-visible behaviour Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * oprofilefs: add missing ->i_mutex locking in object creationAl Viro2013-02-221-3/+13
| | | | | | | | | | | | | | Right now it's safe only during initial mount *and* functions are asking to be abused for dynamic adding of objects. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * spufs_mkdir(): don't d_add() on negative parentAl Viro2013-02-221-43/+21
| | | | | | | | | | | | | | NOTE: this really needs testing - I could've easily fucked up refcounting in there. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * hostfs: directory methods have no business in non-directory inode_operationsAl Viro2013-02-221-8/+0
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * xenfs: switch to pure simple_fill_super()Al Viro2013-02-221-55/+11
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * __d_materialise_unique() is too genericAl Viro2013-02-221-14/+5
| | | | | | | | | | | | | | Its first argument is always non-root, while the second one is always root. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * fs: Fix possible use-after-free with AIOJan Kara2013-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running AIO is pinning inode in memory using file reference. Once AIO is completed using aio_complete(), file reference is put and inode can be freed from memory. So we have to be sure that calling aio_complete() is the last thing we do with the inode. CC: Christoph Hellwig <hch@infradead.org> CC: Jens Axboe <axboe@kernel.dk> CC: Jeff Moyer <jmoyer@redhat.com> CC: stable@vger.kernel.org Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * constify d_lookup() argumentsAl Viro2013-02-222-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * constify __d_lookup() argumentsAl Viro2013-02-222-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * lookup_slow: get rid of name argumentAl Viro2013-02-221-4/+3
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| * lookup_fast: get rid of name argumentAl Viro2013-02-221-5/+5
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>