aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
Commit message (Collapse)AuthorAge
...
* | | vfs: re-introduce MAY_CHDIREric Paris2010-08-02
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Currently MAY_ACCESS means that filesystems must check the permissions right then and not rely on cached results or the results of future operations on the object. This can be because of a call to sys_access() or because of a call to chdir() which needs to check search without relying on any future operations inside that dir. I plan to use MAY_ACCESS for other purposes in the security system, so I split the MAY_ACCESS and the MAY_CHDIR cases. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Stephen D. Smalley <sds@tycho.nsa.gov> Signed-off-by: James Morris <jmorris@namei.org>
* | NFS: Fix a typo in include/linux/nfs_fs.hTrond Myklebust2010-08-01
| | | | | | | | | | | | | | | | | | | | | | | | nfs_commit_inode() needs to be defined irrespectively of whether or not we are supporting NFSv3 and NFSv4. Allow the compiler to optimise away code in the NFSv2-only case by converting it into an inlined stub function. Reported-and-tested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | NFS: Ensure that writepage respects the nonblock flagTrond Myklebust2010-07-30
| | | | | | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | NFS: kswapd must not block in nfs_release_pageTrond Myklebust2010-07-30
| | | | | | | | | | | | | | | | | | | | | | See https://bugzilla.kernel.org/show_bug.cgi?id=16056 If other processes are blocked waiting for kswapd to free up some memory so that they can make progress, then we cannot allow kswapd to block on those processes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
* | nfs: include space for the NUL in root pathDan Carpenter2010-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In root_nfs_name() it does the following: if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) { printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n"); return -1; } sprintf(nfs_export_path, buf, cp); In the original code if (strlen(buf) + strlen(cp) == NFS_MAXPATHLEN) then the sprintf() would lead to an overflow. Generally the rest of the code assumes that the path can have NFS_MAXPATHLEN (1024) characters and a NUL terminator so the fix is to add space to the nfs_export_path[] buffer. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* | mm: add context argument to shrinker callbackDave Chinner2010-07-19
|/ | | | | | | | | | | | The current shrinker implementation requires the registered callback to have global state to work from. This makes it difficult to shrink caches that are not global (e.g. per-filesystem caches). Pass the shrinker structure to the callback so that users can embed the shrinker structure in the context the shrinker needs to operate on and get back to it in the callback via container_of(). Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
* NFSv4: Fix an embarassing typo in encode_attrs()Trond Myklebust2010-06-22
| | | | | | | | | Apparently, we have never been able to set the atime correctly from the NFSv4 client. Reported-by: 小倉一夫 <ka-ogura@bd6.so-net.ne.jp> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
* NFSv4: Ensure that /proc/self/mountinfo displays the minor version numberTrond Myklebust2010-06-22
| | | | | | | | Currently, we do not display the minor version mount parameter in the /proc mount info. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
* NFSv4.1: Ensure that we initialise the session when following a referralTrond Myklebust2010-06-22
| | | | | | | Put the code that is common to both the referral and ordinary mount cases into a common helper routine. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* nfs4 use mandatory attribute file type in nfs4_get_rootAndy Adamson2010-06-22
| | | | | | | | | S_ISDIR(fsinfo.fattr->mode) checks the file type rather than the mode bits, so we should be checking for the NFS_ATTR_FATTR_TYPE fattr property. Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
* drop unused dentry argument to ->fsyncChristoph Hellwig2010-05-27
| | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* NFS: Fix another nfs_wb_page() deadlockTrond Myklebust2010-05-26
| | | | | | | | | | | J.R. Okajima reports that the call to sync_inode() in nfs_wb_page() can deadlock with other writeback flush calls. It boils down to the fact that we cannot ever call writeback_single_inode() while holding a page lock (even if we do set nr_to_write to zero) since another process may already be waiting in the call to do_writepages(), and so will deny us the I_SYNC lock. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Ensure that we mark the inode as dirty if we exit early from commitTrond Myklebust2010-05-26
| | | | | | | | | If we exit from nfs_commit_inode() without ensuring that the COMMIT rpc call has been completed, we must re-mark the inode as dirty. Otherwise, future calls to sync_inode() with the WB_SYNC_ALL flag set will fail to ensure that the data is on the disk. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix a lock imbalance typo in nfs_access_cache_shrinkerTrond Myklebust2010-05-26
| | | | | | | | | Commit 9c7e7e23371e629dbb3b341610a418cdf1c19d91 (NFS: Don't call iput() in nfs_access_cache_shrinker) unintentionally removed the spin unlock for the inode->i_lock. Reported-by: David Howells <dhowells@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* kernel-wide: replace USHORT_MAX, SHORT_MAX and SHORT_MIN with USHRT_MAX, ↵Alexey Dobriyan2010-05-25
| | | | | | | | | | | | | | | | SHRT_MAX and SHRT_MIN - C99 knows about USHRT_MAX/SHRT_MAX/SHRT_MIN, not USHORT_MAX/SHORT_MAX/SHORT_MIN. - Make SHRT_MIN of type s16, not int, for consistency. [akpm@linux-foundation.org: fix drivers/dma/timb_dma.c] [akpm@linux-foundation.org: fix security/keys/keyring.c] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* NFS: Don't call iput() in nfs_access_cache_shrinkerTrond Myklebust2010-05-14
| | | | | | | | iput() can potentially attempt to allocate memory, so we should avoid calling it in a memory shrinker. Instead, rely on the fact that iput() will call nfs_access_zap_cache(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Clean up nfs_access_zap_cache()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Don't run nfs_access_cache_shrinker() when the mask is GFP_NOFSTrond Myklebust2010-05-14
| | | | | | | Both iput() and put_rpccred() might allocate memory under certain circumstances, so make sure that we don't recurse and deadlock... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Read requests can use GFP_KERNEL.Trond Myklebust2010-05-14
| | | | | | | There is no danger of deadlock should the allocation trigger page writeback. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Clean up nfs_create_request()Trond Myklebust2010-05-14
| | | | | | There is no point in looping if we're out of memory. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Don't use GFP_KERNEL allocations in state recoveryTrond Myklebust2010-05-14
| | | | | | | | | | | | We do not want to have the state recovery thread kick off and wait for a memory reclaim, since that may deadlock when the writebacks end up waiting for the state recovery thread to complete. The safe thing is therefore to use GFP_NOFS in all open, close, delegation return, lock, etc. operations that may be called by the state recovery thread. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Calldata for nfs4_renew_done()Chuck Lever2010-05-14
| | | | | | | | | | | | | | | | | | | | | | I'm about to change task->tk_start from a jiffies value to a ktime_t value in order to make RPC RTT reporting more precise. Recently (commit dc96aef9) nfs4_renew_done() started to reference task->tk_start so that a jiffies value no longer had to be passed from nfs4_proc_async_renew(). This allowed the calldata to point to an nfs_client instead. Changing task->tk_start to a ktime_t value makes it effectively useless for renew timestamps, so we need to restore the pre-dc96aef9 logic that provided a jiffies "start" timestamp to nfs4_renew_done(). Both an nfs_client pointer and a timestamp need to be passed to nfs4_renew_done(), so create a new nfs_renewdata structure that contains both, resembling what is already done for delegreturn, lock, and unlock. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Squelch compiler warning in nfs_add_server_stats()Chuck Lever2010-05-14
| | | | | | | | | | | | | | | | | | Clean up: fs/nfs/iostat.h: In function ‘nfs_add_server_stats’: fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions fs/nfs/iostat.h:41: warning: comparison between signed and unsigned integer expressions Commit fce22848 replaced the open-coded per-cpu logic in several functions in fs/nfs/iostat.h with a single invocation of this_cpu_ptr(). This macro assumes its second argument is signed, not unsigned. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Clean up fscache_uniq mount optionChuck Lever2010-05-14
| | | | | | | | Clean up: fscache_uniq takes a string, so it should be included with the other string mount option definitions, by convention. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Squelch compiler warningChuck Lever2010-05-14
| | | | | | | | | | | | | | | Seen with -Wextra: /home/cel/linux/fs/nfs/fscache.c: In function ‘__nfs_readpages_from_fscache’: /home/cel/linux/fs/nfs/fscache.c:479: warning: comparison between signed and unsigned integer expressions The comparison implicitly converts "int" to "unsigned", making it safe. But there's no need for the implicit type conversions here, and the dfprintk() already uses a "%u" formatter for "npages." Better to reduce confusion. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Clean up the NFSv4 setclientid operationTrond Myklebust2010-05-14
| | | | | Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Allow attribute caching with 'noac' mounts if client holds a delegationTrond Myklebust2010-05-14
| | | | | | | | If the server has given us a delegation on a file, we _know_ that we can cache the attribute information even when the user has specified 'noac'. Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Fix up the documentation for nfs_do_refmountTrond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Replace nfsroot on-stack filehandleTrond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Cleanup file handle allocations in fs/nfs/super.cTrond Myklebust2010-05-14
| | | | | | Use the new helper functions instead of open coding. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Prevent the mount code from looping forever on broken exportsTrond Myklebust2010-05-14
| | | | | | | | Keep a global count of how many referrals that the current task has traversed on a path lookup. Return ELOOP if the count exceeds MAX_NESTED_LINKS. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs3_proc_getacl() and nfs3_proc_setacl()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_statfs()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_setattr()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs4_proc_create()Trond Myklebust2010-05-14
| | | | | | | Move the O_EXCL open handling into _nfs4_do_open() where it belongs. Doing so also allows us to reuse the struct fattr from the opendata. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_proc_symlink()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_proc_createTrond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_rmdirTrond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_proc_remove()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs3_proc_readlink()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_link()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_readdir()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs3_proc_rename() and nfs4_proc_rename()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_revalidate_inode()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Reduce stack footprint of nfs4_proc_access() and nfs3_proc_access()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Reduce the stack footprint of nfs4_remote_referral_get_sbTrond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Reduce stack footprint of nfs4_get_root()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_follow_remote_path()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_lookupTrond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Reduce the stack footprint of try_location()Trond Myklebust2010-05-14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>