summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* SUNRPC: Mark auth and cred operation tables as constant.Trond Myklebust2007-07-108-25/+22
| | | | | | Also do the same for gss_api operation tables. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Rename rpcauth_destroy() to rpcauth_release()Trond Myklebust2007-07-103-4/+4
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Add the helper function 'rpc_call_null()'Trond Myklebust2007-07-102-0/+12
| | | | | | | Does a NULL RPC call and returns a pointer to the resulting rpc_task. The call may be either synchronous or asynchronous. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Make rpc_ping() staticTrond Myklebust2007-07-102-2/+3
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Fix races in rpcauth_createTrond Myklebust2007-07-101-11/+24
| | | | | | See the FIXME: auth_flavors[] really needs a lock and module refcounting. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Fix a memory leak in gss_create()Trond Myklebust2007-07-101-4/+6
| | | | | | | Fix a memory leak in gss_create() whereby the rpc credcache was not being freed if the rpc_mkpipe() call failed. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Fix a typo in unx_create()Trond Myklebust2007-07-101-1/+1
| | | | | | | We want to set the unix_cred_cache.nextgc on the first call to unx_create(), which should be when unix_auth.au_count === 1 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Fix a memory leak in the auth credcache codeTrond Myklebust2007-07-105-6/+22
| | | | | | | | | | | | | | The leak only affects the RPCSEC_GSS caches, since they are the only ones that are dynamically allocated... Rename the existing rpcauth_free_credcache() to rpcauth_clear_credcache() in order to better describe its role, then add a new function rpcauth_destroy_credcache() that actually frees the cache in addition to clearing it out. Also move the call to destroy the credcache in gss_destroy() to come before the rpc upcall pipe is unlinked. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Add a field to track the number of kernel users of an rpc_pipeTrond Myklebust2007-07-102-4/+9
| | | | | | This allows us to correctly deduce when we need to remove the pipe. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Clean up rpc_pipefs.Trond Myklebust2007-07-101-27/+32
| | | | | | | | | | Add a dentry_ops with a d_delete() method in order to ensure that dentries are removed as soon as the last reference is gone. Clean up rpc_depopulate() so that it only removes files that were created via rpc_populate(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Enable non-exclusive create in rpc_mkpipe()Trond Myklebust2007-07-101-4/+14
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Add a downcall queue to struct rpc_inodeTrond Myklebust2007-07-103-19/+12
| | | | | | | | Currently, the downcall queue is tied to the struct gss_auth, which means that different RPCSEC_GSS pseudoflavours must use different upcall pipes. Add a list to struct rpc_inode that can be used instead. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Always match an upcall message in gss_pipe_downcall()Trond Myklebust2007-07-101-31/+27
| | | | | | | | | | | | It used to be possible for an rpc.gssd daemon to stuff the RPC credential cache for any rpc client simply by creating RPCSEC_GSS contexts and then doing downcalls. In practice, no daemons ever made use of this feature. Remove this feature now, since it will be impossible to figure out which mechanism a given context actually matches if we enable more than one gss mechanism to use the same upcall pipe. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Remove the gss_auth spinlockTrond Myklebust2007-07-101-22/+25
| | | | | | We're just as well off using the inode spinlock instead. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Add a backpointer from the struct rpc_cred to the rpc_authTrond Myklebust2007-07-104-1/+8
| | | | | | | | Cleans up an issue whereby rpcsec_gss uses the rpc_clnt->cl_auth. If we want to be able to add several rpc_auths to a single rpc_clnt, then this abuse must go. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: fix hang due to eventd deadlock...Trond Myklebust2007-07-102-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | Brian Behlendorf writes: The root cause of the NFS hang we were observing appears to be a rare deadlock between the kernel provided usermodehelper API and the linux NFS client. The deadlock can arise because both of these services use the generic linux work queues. The usermodehelper API run the specified user application in the context of the work queue. And NFS submits both cleanup and reconnect work to the generic work queue for handling. Normally this is fine but a deadlock can result in the following situation. - NFS client is in a disconnected state - [events/0] runs a usermodehelper app with an NFS dependent operation, this triggers an NFS reconnect. - NFS reconnect happens to be submitted to [events/0] work queue. - Deadlock, the [events/0] work queue will never process the reconnect because it is blocked on the previous NFS dependent operation which will not complete.` The solution is simply to run reconnect requests on rpciod. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: clean up rpc_call_async/rpc_call_sync/rpc_run_taskTrond Myklebust2007-07-102-69/+69
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Move rpc_register_client and friends into net/sunrpc/clnt.cTrond Myklebust2007-07-103-64/+57
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Remove redundant calls to rpciod_up()/rpciod_down()Trond Myklebust2007-07-106-34/+3
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Make create_client() take a reference to the rpciod workqueueTrond Myklebust2007-07-102-31/+7
| | | | | | | Ensures that an rpc_client always has the possibility to send asynchronous RPC calls. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Optimise rpciod_up()Trond Myklebust2007-07-101-28/+21
| | | | | | | | Instead of taking the mutex every time we just need to increment/decrement rpciod_users, we can optmise by using atomic_inc_not_zero and atomic_dec_and_test. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Don't create an rpc_pipefs directory before rpc_clone is initialisedTrond Myklebust2007-07-101-8/+8
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Remove rpc_clnt->cl_countTrond Myklebust2007-07-104-22/+4
| | | | | | | | | | | | The kref now does most of what cl_count + cl_user used to do. The only remaining role for cl_count is to tell us if we are in a 'shutdown' phase. We can provide that information using a single bit field instead of a full atomic counter. Also rename rpc_destroy_client() to rpc_close_client(), which reflects better what its role is these days. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Make rpc_clone take a reference instead of using cl_countTrond Myklebust2007-07-101-2/+2
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Kill rpc_clnt->cl_oneshotTrond Myklebust2007-07-106-32/+14
| | | | | | | Replace it with explicit calls to rpc_shutdown_client() or rpc_destroy_client() (for the case of asynchronous calls). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Kill rpc_clnt->cl_deadTrond Myklebust2007-07-102-17/+4
| | | | | | | Its use is at best racy, and there is only one user (lockd), which has additional locking that makes the whole thing redundant. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Convert rpc_clnt->cl_users to a krefTrond Myklebust2007-07-105-44/+35
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Clean up tk_pid allocation and make it locklessTrond Myklebust2007-07-101-7/+15
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Add a per-rpc_clnt spinlockTrond Myklebust2007-07-103-20/+30
| | | | | | | Use that to protect the rpc_clnt->cl_tasks list instead of using a global lock. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* SUNRPC: Move rpc_task->tk_task list into struct rpc_clntTrond Myklebust2007-07-104-48/+83
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Convert struct nfs4_opendata to use struct krefTrond Myklebust2007-07-101-23/+30
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Convert struct nfs_open_context to use a krefTrond Myklebust2007-07-102-18/+25
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: reduce latency by using conditional rescheduling in nfs_scan_listTrond Myklebust2007-07-101-1/+2
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Prevent integer overflow in nfs_scan_list()Trond Myklebust2007-07-102-1/+3
| | | | | | | Also ensure that nfs_inode ncommit and npages are large enough to represent all possible values for the number of pages. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Remove the redundant 'dirty' and 'commit' lists from nfs_inodeTrond Myklebust2007-07-104-14/+2
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS cleanup: speed up nfs_scan_commit using radix tree tagsTrond Myklebust2007-07-103-10/+15
| | | | | | Add a tag for requests that are waiting for a COMMIT Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS cleanup: Rename NFS_PAGE_TAG_WRITEBACK to NFS_PAGE_TAG_LOCKEDTrond Myklebust2007-07-103-18/+17
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Convert struct nfs_page to use krefsTrond Myklebust2007-07-103-14/+16
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Fix an Oops in the nfs_access_cache_shrinker()Trond Myklebust2007-07-101-1/+2
| | | | | | The nfs_access_cache_shrinker may race with nfs_access_zap_cache(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: nfs3_proc_create() should use nfs_post_op_update_inode()Trond Myklebust2007-07-101-3/+1
| | | | | | | Also get rid of a redundant call to nfs_setattr_update_inode(). The call to nfs3_proc_setattr() already takes care of that. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS4: on a O_EXCL OPEN make sure SETATTR sets the fields holding the verifierJeff Layton2007-07-104-2/+29
| | | | | | | | | | | | | | | | | The Linux NFS4 client simply skips over the bitmask in an O_EXCL open call and so it doesn't bother to reset any fields that may be holding the verifier. This patch has us save the first two words of the bitmask (which is all the current client has #defines for). The client then later checks this bitmask and turns on the appropriate flags in the sattr->ia_verify field for the following SETATTR call. This patch only currently checks to see if the server used the atime and mtime slots for the verifier (which is what the Linux server uses for this). I'm not sure of what other fields the server could reasonably use, but adding checks for others should be trivial. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Re-enable forced umountsTrond Myklebust2007-07-101-0/+13
| | | | | | They disappeared some time around 2.6.18. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Use GFP_HIGHUSER for page allocation in nfs_symlink()Jeff Layton2007-07-101-1/+1
| | | | | | | | nfs_symlink() allocates a GFP_KERNEL page for the pagecache. Most pagecache pages are allocated using GFP_HIGHUSER, and there's no reason not to do that in nfs_symlink() as well. Signed-off-by: Jeff Layton <jlayton@redhat.com>
* NFS: Fix nfs_reval_fsid()Trond Myklebust2007-07-102-7/+6
| | | | | | | We don't need to revalidate the fsid on the root directory. It suffices to revalidate it on the current directory. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Clean up nfs4_call_async()Trond Myklebust2007-07-103-22/+14
| | | | | | Use rpc_run_task() instead of doing it ourselves. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Ensure that nfs4_do_close() doesn't race with umountTrond Myklebust2007-07-104-38/+26
| | | | | | | | | | | nfs4_do_close() does not currently have any way to ensure that the user won't attempt to unmount the partition while the asynchronous RPC call is completing. This again may cause Oopses in nfs_update_inode(). Add a vfsmount argument to nfs4_close_state to ensure that the partition remains mounted while we're closing the file. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Ensure asynchronous open() calls always pin the mountpointTrond Myklebust2007-07-102-18/+32
| | | | | | | | A number of race conditions may currently ensue if the user presses ^C and then unmounts the partition while an asynchronous open() is in progress. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFSv4: Cleanup: pass the nfs_open_context to open recovery codeTrond Myklebust2007-07-103-21/+21
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Replace vfsmount and dentry in nfs_open_context with struct pathTrond Myklebust2007-07-108-29/+29
| | | | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* NFS: Minor read optimisation...Trond Myklebust2007-07-101-11/+23
| | | | | | | | Since PG_uptodate may now end up getting set during the call to nfs_wb_page(), we can avoid putting a read request on the wire in those situations. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>