aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2012-02-06SUNRPC: remove an unneeded NULL check in xprt_connect()Dan Carpenter1-3/+1
We check "task->tk_rqstp" and then we dereference it without checking on the next line. The only caller is call_connect() and that has a check which prevents it from calling xprt_connect() with a NULL. if (task->tk_status < 0) return; If "task->tk_rqstp" were NULL then "tk_status" would be -EAGAIN. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-02-06NFS: Call test_stateid() and free_stateid() with correct stateidsBryan Schumaker1-11/+47
I noticed that test_stateid() was always using the same stateid for open and lock recovery. After poking around a bit, I discovered that it was always testing with a delegation stateid (even if there was no delegation present). I figured this wasn't correct, so now delegation and open stateids are tested during open_expired() and lock stateids are tested during lock_expired(). Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-02-06NFS: Pass a stateid to test_stateid() and free_stateid()Bryan Schumaker2-16/+24
This takes the guesswork out of what stateid to use. The caller is expected to figure this out and pass in the correct one. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-02-06SUNRPC: Change the default limit to the number of TCP slotsTrond Myklebust2-2/+2
Since the scheme of limiting the number of TCP slots to whatever will fit in the current TCP window seems to be working well (Andy reports getting within 20% of the 'iperf' send performance on a 10GigE link) we should just let that be the default mode of operation. Users may still set their own limits using the tcp_max_slot_table_entries parameter if they need to. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-02-06SUNRPC: Adding status trace pointsSteve Dickson2-0/+57
This patch adds three trace points to the status routines in the sunrpc state machine. The goal of these trace points is to give an Admin the ability to check on binding status or connection status to see if there is a potential problem. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-02-06SUNRPC: Fix up sunrpc trace eventsTrond Myklebust1-3/+3
The reporting of the RPC queue name needs to use the __string() event interface. Reported-by: Neil Horman <nhorman@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFSv4: ACCESS validation doesn't require a full attribute refreshTrond Myklebust1-1/+1
We only really need to check the change attribute, so let's just use the server->cache_consistency_bitmask. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFSv4: Don't decode fs_locations if we didn't ask for them...Trond Myklebust1-9/+14
Currently, the server can potentially cause us to Oops by returning an fs_locations request that we didn't actually request. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31nfs: remove unneeded NULL pointer check in nfs4_remote_mountJeff Layton1-2/+1
"data" is never NULL here. Reported-by: Eric Paris <eparis@redhat.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: fixup for namespace changesTrond Myklebust1-1/+1
Fixes this build error when CONFIG_NET_NS is not set: net/sunrpc/svcsock.c: In function 'svc_setup_socket': net/sunrpc/svcsock.c:1412:40: error: 'struct sock_common' has no member named 'skc_net' Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31pnfs: clean up initiate_file_draining layout lookupBenny Halevy1-18/+38
Fixes the following compiler warning: fs/nfs/callback_proc.c: In function 'do_callback_layoutrecall': fs/nfs/callback_proc.c:115:26: warning: 'lo' may be used uninitialized in this function Reported-by: Jim Rees <rees@umich.edu> Signed-off-by: Benny Halevy <bhalevy@tonian.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFS: Use kcalloc() when allocating arraysTrond Myklebust2-2/+2
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFSv4: Avoid thundering herd issues with nfs_release_seqidTrond Myklebust2-6/+16
Store a pointer to the rpc_task in struct nfs_seqid so that we can wake up only that request that is able to grab the lock after we've released it. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: Add trace events to the sunrpc subsystemTrond Myklebust3-1/+137
Add declarations to allow tracing of RPC call creation, running, sleeping, and destruction. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: constify the rpc_programTrond Myklebust17-54/+54
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: constify rpc_program->nameTrond Myklebust2-4/+5
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: constify rpc_clnt fields cl_server and cl_protnameTrond Myklebust3-23/+17
...and get rid of the superfluous cl_inline_name. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: search for service transports in network namespace contextStanislav Kinsbursky4-5/+10
Service transports are parametrized by network namespace. And thus lookup of transport instance have to take network namespace into account. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
2012-01-31NFS: remove unused nfs4_find_client_no_ident functionStanislav Kinsbursky2-28/+0
Looks like this function survived after some cleanup patch without a reason. Now it's not called or referenced and I believe, that it can be simply removed. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: register service stats /proc entries in passed network namespace contextStanislav Kinsbursky3-10/+11
This patch makes it possible to create NFSd program entry ("/proc/net/rpc/nfsd") in passed network namespace context instead of hard-coded "init_net". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31sunrpc: fix stats.h for CONFIG_PROC_FS not enabledRandy Dunlap1-2/+2
Fix build errors in linux/sunrpc/stats.h when CONFIG_PROC_FS is not enabled: - add parameter names to inline functions - fix placement of '(' in rpc_proc_unregister() Fixes these errors: include/linux/sunrpc/stats.h:72:63: error: parameter name omitted include/linux/sunrpc/stats.h:73:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'net' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: register RPC stats /proc entries in passed network namespace contextStanislav Kinsbursky3-14/+15
This patch makes it possible to create NFS program entry ("/proc/net/rpc/nfs") in passed network namespace context instead of hard-coded "init_net". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFS: decode destination address in proper network namespace contextStanislav Kinsbursky1-3/+4
This patch replaces "init_net" with NFS client's owner net in rpc_pton() call in decode_ds_addr(). Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFS: parse DNS cache in proper network namespace contextStanislav Kinsbursky1-1/+1
This patch replaces "init_net" with cache's owner net in rpc_pton() call. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: generic cache register routines removedStanislav Kinsbursky2-14/+0
All cache users now uses network-namespace-aware routines, so generic ones are obsolete. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
2012-01-31SUNRPC: ip map cache per network namespace cleanupStanislav Kinsbursky1-41/+30
This patch converts ip_map_cache per network namespace implemenetation to the same view, as other caches done in the series. Besides generalization, code becomes shorter with this patch. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
2012-01-31SUNRPC: create GSS auth cache per network namespaceStanislav Kinsbursky5-50/+141
This patch makes GSS auth cache details allocated and registered per network namespace context. Thus with this patch rsi_cache and rsc_cache contents for network namespace "X" are controlled from proc file system mount for the same network namespace "X". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
2012-01-31SUNRPC: create unix gid cache per network namespaceStanislav Kinsbursky3-18/+52
v2: 1) fixed silly usage of template cache as a real one (this code left from static global cache for all) This patch makes unix_gid_cache cache detail allocated and registered per network namespace context. Thus with this patch unix_gid_cache contents for network namespace "X" are controlled from proc file system mount for the same network namespace "X". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
2012-01-31SUNRPC: cache creation and destruction routines introducedStanislav Kinsbursky2-0/+30
This patch prepares infrastructure for network namespace aware cache detail allocation. One note about adding network namespace link to cache structure. It's going to be used later in NFS DNS cache parsing routine (nfs_dns_parse for rpc_pton() call). Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Acked-by: J. Bruce Fields <bfields@redhat.com>
2012-01-31SUNRPC: unregister service on creation in current network namespaceStanislav Kinsbursky3-13/+14
On service shutdown we can be sure, that no more users of it left except current. Thus it looks like using current network namespace context is safe in this case. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: register service on creation in current network namespaceStanislav Kinsbursky1-4/+5
Service, using rpcbind (Lockd, NFSd) are starting from userspace call and thus we can use current network namespace. There could be a problem with NFSd service, because it's creation can be called through NFSd fs from different network namespace. But this is a part of "NFSd per net ns" task and will be fixed in future. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: pass network namespace to service registering routinesStanislav Kinsbursky3-21/+26
Lockd and NFSd services will handle requests from and to many network nsamespaces. And thus have to be registered and unregistered per network namespace. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: use proper network namespace in rpcbind RPCBPROC_GETADDR procedureStanislav Kinsbursky1-1/+2
Pass request socket network namespace to rpc_uaddr2sockaddr() instead of hardcoded "init_net", when decoding address in RPCBPROC_GETADDR procedure. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: parametrize rpc_uaddr2sockaddr() by network contextStanislav Kinsbursky4-6/+8
Parametrize rpc_uaddr2sockaddr() by network context and thus force it's callers to pass in network context instead of using hard-coded "init_net". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: parametrize rpc_pton() by network contextStanislav Kinsbursky8-12/+13
Parametrize rpc_pton() by network context and thus force it's callers to pass in network context instead of using hard-coded "init_net". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: parametrize rpc_pton6() by network contextStanislav Kinsbursky1-4/+4
Parametrize rpc_pton6() by network context and thus force it's caller to pass in network context instead of using hard-coded "init_net". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: parametrize rpc_parse_scope_id() by network contextStanislav Kinsbursky1-4/+5
Parametrize rpc_parse_scope_id() by network context and thus force it's caller to pass in network context instead of using hard-coded "init_net". Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: parametrize local rpcbind clients creation with net nsStanislav Kinsbursky3-8/+7
These client are per network namespace and thus can be created for different network namespaces. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: register rpcbind programs in passed network namespase contextStanislav Kinsbursky3-11/+12
Registering rpcbind program requires rpcbind clients, which are per network namespace context. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: create rpcbind client in passed network namespace contextStanislav Kinsbursky1-5/+6
Rpcbind clients are per network namespace. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: optimize net_ns dereferencing in rpcbind registering callsStanislav Kinsbursky1-9/+9
Static rpcbind registering functions can be parametrized by network namespace pointer, calculated only once, instead of using init_net pointer (or taking it from current when virtualization will be comleted) in many places. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: optimize net_ns dereferencing in rpcbind creation callsStanislav Kinsbursky1-16/+19
Static rpcbind creation functions can be parametrized by network namespace pointer, calculated only once, instead of using init_net pointer (or taking it from current when virtualization will be comleted) in many places. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: move rpcbind internals to sunrpc part of network namespace contextStanislav Kinsbursky2-29/+40
This patch makes rpcbind logic works in network namespace context. IOW each network namespace will have it's own unique rpcbind internals (clients and friends) required for registering svc services per network namespace. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31SUNRPC: Fix potential races in xprt_lock_write_next()Trond Myklebust6-46/+79
We have to ensure that the wake up from the waitqueue and the assignment of xprt->snd_task are atomic. We can do this by assigning the snd_task while under the waitqueue spinlock. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFS: Ensure that mmapped pages remain stable during writebackTrond Myklebust1-0/+2
Ensure that nfs_vm_page_mkwrite() waits for the page writeback to complete before the application is allowed to modify page contents. The main reason for wanting to do this in NFS is to ensure that the server doesn't get confused if we have to resend the RPC request due to a dropped/missed reply. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFS: Optimise away unnecessary setattrs for open(O_TRUNC);Trond Myklebust3-11/+28
Currently, we will correctly optimise away a truncate that doesn't change the file size. However, in the case of open(O_TRUNC), we also want to optimise away the time changes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFS: Move struct nfs_unique_id into struct nfs_seqid_counterTrond Myklebust3-12/+16
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFSv4: Move contents of struct rpc_sequence into struct nfs_seqid_counterTrond Myklebust2-26/+26
Clean up. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFSv41: Add a new helper nfs4_init_sequence()Trond Myklebust6-46/+65
Clean up Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-31NFSv4: Replace lock_owner->ld_id with an ida based allocatorTrond Myklebust5-76/+15
Again, We're unlikely to ever need more than 2^31 simultaneous lock owners, so let's replace the custom allocator. Now that there are no more users, we can also get rid of the custom allocator code. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>