summaryrefslogtreecommitdiff
path: root/fs/nfs
Commit message (Collapse)AuthorAgeFilesLines
* NFSv4.1: There is no need to init the session more than once...Trond Myklebust2010-06-222-1/+7
| | | | | | Set up a flag to ensure that is indeed the case. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Cleanup for nfs4_alloc_session.Trond Myklebust2010-06-222-7/+7
| | | | | | | There is no reason to change the nfs_client state every time we allocate a new session. Move that line into nfs4_init_client_minor_version. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Clean up exclusive createTrond Myklebust2010-06-221-11/+6
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Deprecate nfs_client->cl_minorversionTrond Myklebust2010-06-221-5/+5
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Fix nfs_async_inode_return_delegation() uglinessTrond Myklebust2010-06-225-19/+8
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Convert the various reboot recovery ops etc to minor version opsTrond Myklebust2010-06-224-38/+18
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Clean up the NFSv4.1 minor version specific operationsTrond Myklebust2010-06-223-9/+37
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Don't store session state in the nfs_client->cl_stateTrond Myklebust2010-06-223-5/+10
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Further cleanup for nfs4_sequence_doneTrond Myklebust2010-06-221-9/+12
| | | | | | | Instead of testing if the nfs_client has a session, we should be testing if the struct nfs4_sequence_res was set up with one. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Make nfs4_setup_sequence take a nfs_server argumentTrond Myklebust2010-06-225-28/+43
| | | | | | | | In anticipation of the day when we have per-filesystem sessions, and also in order to allow the session to change in the event of a filesystem migration event. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Merge the nfs41_proc_async_sequence() and nfs4_proc_sequence()Trond Myklebust2010-06-221-24/+44
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Kill nfs4_async_handle_error() abuses by NFSv4.1Trond Myklebust2010-06-221-37/+41
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Simplify nfs41_sequence_done()Trond Myklebust2010-06-221-14/+12
| | | | | | | | | Nobody uses the rpc_status parameter. It is not obvious why we need the struct nfs_client argument either, when we already have that information in the session. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4.1: Clean up nfs4_setup_sequenceTrond Myklebust2010-06-221-6/+1
| | | | | | | | | | | Firstly, there is little point in first zeroing out the entire struct nfs4_sequence_res, and then initialising all fields save one. Just initialise the last field to zero... Secondly, nfs41_setup_sequence() has only 2 possible return values: 0, or -EAGAIN, so there is no 'terminate rpc task' case. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv41: Fix a memory leak in nfs41_proc_async_sequence()Trond Myklebust2010-06-221-18/+21
| | | | | | | If the call to rpc_call_async() fails, then the arguments will not be freed, since there will be no call to nfs41_sequence_call_done Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Fix an embarassing typo in encode_attrs()Trond Myklebust2010-06-221-2/+2
| | | | | | | | | 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-221-4/+18
| | | | | | | | 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-221-71/+51
| | | | | | | 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-221-1/+1
| | | | | | | | | 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-272-4/+7
| | | | | 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-261-2/+5
| | | | | | | | | | | 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-261-2/+11
| | | | | | | | | 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-261-0/+1
| | | | | | | | | 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-251-2/+2
| | | | | | | | | | | | | | | | 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-141-15/+4
| | | | | | | | 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-141-29/+31
| | | | 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-141-0/+2
| | | | | | | 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-141-2/+2
| | | | | | | 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-141-10/+4
| | | | | | 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-144-35/+39
| | | | | | | | | | | | 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-141-6/+20
| | | | | | | | | | | | | | | | | | | | | | 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-141-3/+3
| | | | | | | | | | | | | | | | | | 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-141-9/+9
| | | | | | | | 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-141-1/+2
| | | | | | | | | | | | | | | 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-144-23/+34
| | | | | 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-142-9/+18
| | | | | | | | 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-141-1/+1
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Replace nfsroot on-stack filehandleTrond Myklebust2010-05-141-6/+8
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Cleanup file handle allocations in fs/nfs/super.cTrond Myklebust2010-05-141-4/+4
| | | | | | 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-141-0/+73
| | | | | | | | 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-141-7/+16
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_statfs()Trond Myklebust2010-05-141-5/+9
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_setattr()Trond Myklebust2010-05-141-4/+10
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs4_proc_create()Trond Myklebust2010-05-141-10/+15
| | | | | | | 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-141-10/+16
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_proc_createTrond Myklebust2010-05-141-52/+66
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_rmdirTrond Myklebust2010-05-141-5/+10
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs_proc_remove()Trond Myklebust2010-05-145-11/+23
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce stack footprint of nfs3_proc_readlink()Trond Myklebust2010-05-141-5/+10
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Reduce the stack footprint of nfs_link()Trond Myklebust2010-05-142-17/+21
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>