24 Nov, 2015
1 commit
-
If clp->cl_cb_ident is zero, then nfs_cb_idr_remove_locked() skips removing
it when the nfs_client is freed. A decoding or server bug can then find
and try to put that first nfs_client which would lead to a crash.Signed-off-by: Benjamin Coddington
Fixes: d6870312659d ("nfs4client: convert to idr_alloc()")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust
18 Aug, 2015
1 commit
-
They already exist and do the exact same thing. Let's save ourselves
several lines of code!Signed-off-by: Anna Schumaker
Signed-off-by: Trond Myklebust
01 Jul, 2015
1 commit
-
Commit 7b1f1fd184 "NFSv4/4.1: Fix bugs in nfs4[01]_walk_client_list"
have change the logical of the list_for_each_entry().Signed-off-by: Kinglong Mee
Signed-off-by: Trond Myklebust
27 Apr, 2015
1 commit
-
Pull NFS client updates from Trond Myklebust:
"Another set of mainly bugfixes and a couple of cleanups. No new
functionality in this round.Highlights include:
Stable patches:
- Fix a regression in /proc/self/mountstats
- Fix the pNFS flexfiles O_DIRECT support
- Fix high load average due to callback thread sleepingBugfixes:
- Various patches to fix the pNFS layoutcommit support
- Do not cache pNFS deviceids unless server notifications are enabled
- Fix a SUNRPC transport reconnection regression
- make debugfs file creation failure non-fatal in SUNRPC
- Another fix for circular directory warnings on NFSv4 "junctioned"
mountpoints
- Fix locking around NFSv4.2 fallocate() support
- Truncating NFSv4 file opens should also sync O_DIRECT writes
- Prevent infinite loop in rpcrdma_ep_create()Features:
- Various improvements to the RDMA transport code's handling of
memory registration
- Various code cleanups"* tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (55 commits)
fs/nfs: fix new compiler warning about boolean in switch
nfs: Remove unneeded casts in nfs
NFS: Don't attempt to decode missing directory entries
Revert "nfs: replace nfs_add_stats with nfs_inc_stats when add one"
NFS: Rename idmap.c to nfs4idmap.c
NFS: Move nfs_idmap.h into fs/nfs/
NFS: Remove CONFIG_NFS_V4 checks from nfs_idmap.h
NFS: Add a stub for GETDEVICELIST
nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes
nfs: fix DIO good bytes calculation
nfs: Fetch MOUNTED_ON_FILEID when updating an inode
sunrpc: make debugfs file creation failure non-fatal
nfs: fix high load average due to callback thread sleeping
NFS: Reduce time spent holding the i_mutex during fallocate()
NFS: Don't zap caches on fallocate()
xprtrdma: Make rpcrdma_{un}map_one() into inline functions
xprtrdma: Handle non-SEND completions via a callout
xprtrdma: Add "open" memreg op
xprtrdma: Add "destroy MRs" memreg op
xprtrdma: Add "reset MRs" memreg op
...
24 Apr, 2015
1 commit
-
This file is only used internally to the NFS v4 module, so it doesn't
need to be in the global include path. I also renamed it from
nfs_idmap.h to nfs4idmap.h to emphasize that it's an NFSv4-only include
file.Signed-off-by: Anna Schumaker
Signed-off-by: Trond Myklebust
16 Apr, 2015
1 commit
-
that's the bulk of filesystem drivers dealing with inodes of their own
Signed-off-by: David Howells
Signed-off-by: Al Viro
04 Mar, 2015
1 commit
-
We do not want to allow a race with another NFS mount to cause
nfs41_walk_client_list() to establish a lease on our nfs_client before
we're done checking for trunking.Signed-off-by: Trond Myklebust
04 Feb, 2015
3 commits
-
* flexfiles: (53 commits)
pnfs: lookup new lseg at lseg boundary
nfs41: .init_read and .init_write can be called with valid pg_lseg
pnfs: Update documentation on the Layout Drivers
pnfs/flexfiles: Add the FlexFile Layout Driver
nfs: count DIO good bytes correctly with mirroring
nfs41: wait for LAYOUTRETURN before retrying LAYOUTGET
nfs: add a helper to set NFS_ODIRECT_RESCHED_WRITES to direct writes
nfs41: add NFS_LAYOUT_RETRY_LAYOUTGET to layout header flags
nfs/flexfiles: send layoutreturn before freeing lseg
nfs41: introduce NFS_LAYOUT_RETURN_BEFORE_CLOSE
nfs41: allow async version layoutreturn
nfs41: add range to layoutreturn args
pnfs: allow LD to ask to resend read through pnfs
nfs: add nfs_pgio_current_mirror helper
nfs: only reset desc->pg_mirror_idx when mirroring is supported
nfs41: add a debug warning if we destroy an unempty layout
pnfs: fail comparison when bucket verifier not set
nfs: mirroring support for direct io
nfs: add mirroring support to pgio layer
pnfs: pass ds_commit_idx through the commit path
...Conflicts:
fs/nfs/pnfs.c
fs/nfs/pnfs.h -
flexfile layout may need to set such when making DS connections.
Signed-off-by: Peng Tao
Signed-off-by: Tom Haynes -
flexfile layout may use different auth flavor as specified by MDS.
Reviewed-by: Jeff Layton
Signed-off-by: Peng Tao
Signed-off-by: Tom Haynes
22 Jan, 2015
1 commit
-
If we start state recovery on a client that failed to initialise correctly,
then we are very likely to Oops.Reported-by: "Mkrtchyan, Tigran"
Link: http://lkml.kernel.org/r/130621862.279655.1421851650684.JavaMail.zimbra@desy.de
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust
06 Jan, 2015
4 commits
-
Detect server trunking across transport protocols. Otherwise, an
RDMA mount and a TCP mount of the same server will end up with
separate nfs_clients using the same clientid4.Reported-by: Dai Ngo
Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust -
While we normally expect the NFSv4 client to always send the same client
owner to all servers, there are a couple of situations where that is not
the case:
1) In NFSv4.0, switching between use of '-omigration' and not will cause
the kernel to switch between using the non-uniform and uniform client
strings.
2) In NFSv4.1, or NFSv4.0 when using uniform client strings, if the
uniquifier string is suddenly changed.This patch will catch those situations by checking the client owner id
in the trunking detection code, and will do the right thing if it notices
that the strings differ.Cc: Chuck Lever
Signed-off-by: Trond Myklebust -
Ensure that we cache the NFSv4/v4.1 client owner_id so that we can
verify it when we're doing trunking detection.Signed-off-by: Trond Myklebust
-
Currently, our trunking code will check for session trunking, but will
fail to detect client id trunking. This is a problem, because it means
that the client will fail to recognise that the two connections represent
shared state, even if they do not permit a shared session.
By removing the check for the server minor id, and only checking the
major id, we will end up doing the right thing in both cases: we close
down the new nfs_client and fall back to using the existing one.Fixes: 05f4c350ee02e ("NFS: Discover NFSv4 server trunking when mounting")
Cc: Chuck Lever
Cc: stable@vger.kernel.org # 3.7.x
Tested-by: Chuck Lever
Signed-off-by: Trond Myklebust
27 Nov, 2014
1 commit
-
Pull pull additional NFS client changes for 3.19 from Anna Schumaker:
"NFS: Generic client side changes from ChuckThese patches fixes for iostats and SETCLIENTID in addition to cleaning
up the nfs4_init_callback() function.Signed-off-by: Anna Schumaker "
* tag 'nfs-cel-for-3.19' of git://git.linux-nfs.org/projects/anna/nfs-rdma:
NFS: Clean up nfs4_init_callback()
NFS: SETCLIENTID XDR buffer sizes are incorrect
SUNRPC: serialize iostats updates
26 Nov, 2014
1 commit
-
nfs4_init_callback() is never invoked for NFS versions other than 4.
Signed-off-by: Chuck Lever
Signed-off-by: Anna Schumaker
25 Nov, 2014
1 commit
-
The nfs_put_client() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Signed-off-by: Trond Myklebust
19 Sep, 2014
1 commit
-
There is a race between nfs4_state_manager() and
nfs_server_remove_lists() that happens during a nfsv3 mount.The v3 mount notices there is already a supper block so
nfs_server_remove_lists() called which uses the nfs_client_lock
spin lock to synchronize access to the client list.At the same time nfs4_state_manager() is running through
the client list looking for work to do, using the same
lock. When nfs4_state_manager() wins the race to the
list, a v3 client pointer is found and not ignored
properly which causes the panic.Moving some protocol checks before the state checking
avoids the panic.CC: Stable Tree
Signed-off-by: Steve Dickson
Signed-off-by: Trond Myklebust
09 Jul, 2014
1 commit
-
We reference cl_hostname in many places for debugging purpose.
So make it useful by setting hostname when calling nfs_get_client.Signed-off-by: Peng Tao
Signed-off-by: Trond Myklebust
19 Mar, 2014
1 commit
-
If a timeout or a signal interrupts the NFSv4 trunking discovery
SETCLIENTID_CONFIRM call, then we don't know whether or not the
server has changed the callback identifier on us.
Assume that it did, and schedule a 'path down' recovery...Tested-by: Steve Dickson
Signed-off-by: Trond Myklebust
18 Feb, 2014
1 commit
-
We need to use the same net namespace that was used to resolve
the hostname and sockaddr arguments.Fixes: 32e62b7c3ef09 (NFS: Add nfs4_update_server)
Cc: Chuck Lever
Signed-off-by: Trond Myklebust
02 Feb, 2014
1 commit
-
There may still be timers active on the session waitqueues. Make sure
that we kill them before freeing the memory.Cc: stable@vger.kernel.org # 3.12+
Signed-off-by: Trond Myklebust
28 Jan, 2014
1 commit
-
The original printk() made sense when the GSSAPI codepaths were called
only when sec=krb5* was explicitly requested. Now however, in many cases
the nfs client will try to acquire GSSAPI credentials by default, even
when it's not requested.Since we don't have a great mechanism to distinguish between the two
cases, just turn the pr_warn into a dprintk instead. With this change we
can also get rid of the ratelimiting.We do need to keep the EXPORT_SYMBOL(gssd_running) in place since
auth_gss.ko needs it and sunrpc.ko provides it. We can however,
eliminate the gssd_running call in the nfs code since that's a bit of a
layering violation.Signed-off-by: Jeff Layton
Signed-off-by: Trond Myklebust
21 Jan, 2014
1 commit
-
If clp is new (cl_count = 1) and it matches another client in
nfs4_discover_server_trunking, the nfs_put_client will free clp before
->cl_preserve_clid is set.Cc: stable@vger.kernel.org # 3.7+
Signed-off-by: Weston Andros Adamson
Signed-off-by: Trond Myklebust
19 Jan, 2014
1 commit
-
Both nfs41_walk_client_list and nfs40_walk_client_list expect the
'status' variable to be set to the value -NFS4ERR_STALE_CLIENTID
if the loop fails to find a match.
The problem is that the 'pos->cl_cons_state > NFS_CS_READY' changes
the value of 'status', and sets it either to the value '0' (which
indicates success), or to the value EINTR.Cc: stable@vger.kernel.org # 3.7.x: 7b1f1fd1842e6: NFSv4/4.1: Fix bugs in
Signed-off-by: Trond Myklebust
07 Dec, 2013
1 commit
-
Currently, the client will attempt to use krb5i in the SETCLIENTID call
even if rpc.gssd isn't running. When that fails, it'll then fall back to
RPC_AUTH_UNIX. This introduced a delay when mounting if rpc.gssd isn't
running, and causes warning messages to pop up in the ring buffer.Check to see if rpc.gssd is running before even attempting to use krb5i
auth, and just silently skip trying to do so if it isn't. In the event
that the admin is actually trying to mount with krb5*, it will still
fail at a later stage of the mount attempt.Signed-off-by: Jeff Layton
Signed-off-by: Trond Myklebust
29 Oct, 2013
7 commits
-
This patch adds support for multiple security options which can be
specified using a colon-delimited list of security flavors (the same
syntax as nfsd's exports file).This is useful, for instance, when NFSv4.x mounts cross SECINFO
boundaries. With this patch a user can use "sec=krb5i,krb5p"
to mount a remote filesystem using krb5i, but can still cross
into krb5p-only exports.New mounts will try all security options before failing. NFSv4.x
SECINFO results will be compared against the sec= flavors to
find the first flavor in both lists or if no match is found will
return -EPERM.Signed-off-by: Weston Andros Adamson
Signed-off-by: Trond Myklebust -
Since the parsed sec= flavor is now stored in nfs_server->auth_info,
we no longer need an nfs_server flag to determine if a sec= option was
used.This flag has not been completely removed because it is still needed for
the (old but still supported) non-text parsed mount options ABI
compatability.Signed-off-by: Weston Andros Adamson
Signed-off-by: Trond Myklebust -
Cache the auth_info structure in nfs_server and pass these values to submounts.
This lays the groundwork for supporting multiple sec= options.
Signed-off-by: Weston Andros Adamson
Signed-off-by: Trond Myklebust -
When filling parsed_mount_data, store the parsed sec= mount option in
the new struct nfs_auth_info and the chosen flavor in selected_flavor.This patch lays the groundwork for supporting multiple sec= options.
Signed-off-by: Weston Andros Adamson
Signed-off-by: Trond Myklebust -
Migration recovery and state recovery must be serialized, so handle
both in the state manager thread.Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust -
Allow code in nfsv4.ko to use _nfs_display_fhandle().
Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust -
New function nfs4_update_server() moves an nfs_server to a different
nfs_client. This is done as part of migration recovery.Though it may be appealing to think of them as the same thing,
migration recovery is not the same as following a referral.For a referral, the client has not descended into the file system
yet: it has no nfs_server, no super block, no inodes or open state.
It is enough to simply instantiate the nfs_server and super block,
and perform a referral mount.For a migration, however, we have all of those things already, and
they have to be moved to a different nfs_client. No local namespace
changes are needed here.Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust
02 Oct, 2013
1 commit
-
The spec states that the client should not resend requests because
the server will disconnect if it needs to drop an RPC request.Signed-off-by: Trond Myklebust
08 Sep, 2013
2 commits
-
In cases where the parent super block was not mounted with a 'sec=' line,
allow autonegotiation of security for the submounts.Signed-off-by: Trond Myklebust
-
NFSv4 security auto-negotiation has been broken since
commit 4580a92d44e2b21c2254fa5fef0f1bfb43c82318 (NFS:
Use server-recommended security flavor by default (NFSv3))
because nfs4_try_mount() will automatically select AUTH_SYS
if it sees no auth flavours.Signed-off-by: Trond Myklebust
Cc: Chuck Lever
07 Sep, 2013
1 commit
-
Commit 4edaa308 "NFS: Use "krb5i" to establish NFSv4 state whenever possible"
uses the nfs_client cl_rpcclient for all state management operations, and
will use krb5i or auth_sys with no regard to the mount command authflavor
choice.The MDS, as any NFSv4.1 mount point, uses the nfs_server rpc client for all
non-state management operations with a different nfs_server for each fsid
encountered traversing the mount point, each with a potentially different
auth flavor.pNFS data servers are not mounted in the normal sense as there is no associated
nfs_server structure. Data servers can also export multiple fsids, each with
a potentially different auth flavor.Data servers need to use the same authflavor as the MDS server rpc client for
non-state management operations. Populate a list of rpc clients with the MDS
server rpc client auth flavor for the DS to use.Signed-off-by: Andy Adamson
Signed-off-by: Trond Myklebust
04 Sep, 2013
1 commit
-
Anchor an nfs4_slot_table in the nfs_client for use with NFSv4.0
transport blocking. It is initialized only for NFSv4.0 nfs_client's.Introduce appropriate minor version ops to handle nfs_client
initialization and shutdown requirements that differ for each minor
version.Signed-off-by: Chuck Lever
Signed-off-by: Trond Myklebust
08 Aug, 2013
1 commit
-
Signed-off-by: Andy Adamson
Signed-off-by: Trond Myklebust