diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
commit | bf97293eb878df3792d9de7213bd7b82135aea77 (patch) | |
tree | 16cb367bd78095b9eb8a54c800fcddfcccb618c7 /fs/nfs/nfs4namespace.c | |
parent | 16d70e15295953b19ecf59e943723a181782b856 (diff) | |
parent | b1b3e136948a2bf4915326acb0d825d7d180753f (diff) |
Merge tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Highlights include:
- Fix NFSv4 recovery so that it doesn't recover lost locks in cases
such as lease loss due to a network partition, where doing so may
result in data corruption. Add a kernel parameter to control
choice of legacy behaviour or not.
- Performance improvements when 2 processes are writing to the same
file.
- Flush data to disk when an RPCSEC_GSS session timeout is imminent.
- Implement NFSv4.1 SP4_MACH_CRED state protection to prevent other
NFS clients from being able to manipulate our lease and file
locking state.
- Allow sharing of RPCSEC_GSS caches between different rpc clients.
- Fix the broken NFSv4 security auto-negotiation between client and
server.
- Fix rmdir() to wait for outstanding sillyrename unlinks to complete
- Add a tracepoint framework for debugging NFSv4 state recovery
issues.
- Add tracing to the generic NFS layer.
- Add tracing for the SUNRPC socket connection state.
- Clean up the rpc_pipefs mount/umount event management.
- Merge more patches from Chuck in preparation for NFSv4 migration
support"
* tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (107 commits)
NFSv4: use mach cred for SECINFO_NO_NAME w/ integrity
NFS: nfs_compare_super shouldn't check the auth flavour unless 'sec=' was set
NFSv4: Allow security autonegotiation for submounts
NFSv4: Disallow security negotiation for lookups when 'sec=' is specified
NFSv4: Fix security auto-negotiation
NFS: Clean up nfs_parse_security_flavors()
NFS: Clean up the auth flavour array mess
NFSv4.1 Use MDS auth flavor for data server connection
NFS: Don't check lock owner compatability unless file is locked (part 2)
NFS: Don't check lock owner compatibility in writes unless file is locked
nfs4: Map NFS4ERR_WRONG_CRED to EPERM
nfs4.1: Add SP4_MACH_CRED write and commit support
nfs4.1: Add SP4_MACH_CRED stateid support
nfs4.1: Add SP4_MACH_CRED secinfo support
nfs4.1: Add SP4_MACH_CRED cleanup support
nfs4.1: Add state protection handler
nfs4.1: Minimal SP4_MACH_CRED implementation
SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid
SUNRPC: Add an identifier for struct rpc_clnt
SUNRPC: Ensure rpc_task->tk_pid is available for tracepoints
...
Diffstat (limited to 'fs/nfs/nfs4namespace.c')
-rw-r--r-- | fs/nfs/nfs4namespace.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index cdb0b41a4810..2288cd3c9278 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/mount.h> | 11 | #include <linux/mount.h> |
12 | #include <linux/namei.h> | 12 | #include <linux/namei.h> |
13 | #include <linux/nfs_fs.h> | 13 | #include <linux/nfs_fs.h> |
14 | #include <linux/nfs_mount.h> | ||
14 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
15 | #include <linux/string.h> | 16 | #include <linux/string.h> |
16 | #include <linux/sunrpc/clnt.h> | 17 | #include <linux/sunrpc/clnt.h> |
@@ -369,21 +370,33 @@ out: | |||
369 | struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry, | 370 | struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry, |
370 | struct nfs_fh *fh, struct nfs_fattr *fattr) | 371 | struct nfs_fh *fh, struct nfs_fattr *fattr) |
371 | { | 372 | { |
373 | rpc_authflavor_t flavor = server->client->cl_auth->au_flavor; | ||
372 | struct dentry *parent = dget_parent(dentry); | 374 | struct dentry *parent = dget_parent(dentry); |
375 | struct inode *dir = parent->d_inode; | ||
376 | struct qstr *name = &dentry->d_name; | ||
373 | struct rpc_clnt *client; | 377 | struct rpc_clnt *client; |
374 | struct vfsmount *mnt; | 378 | struct vfsmount *mnt; |
375 | 379 | ||
376 | /* Look it up again to get its attributes and sec flavor */ | 380 | /* Look it up again to get its attributes and sec flavor */ |
377 | client = nfs4_proc_lookup_mountpoint(parent->d_inode, &dentry->d_name, fh, fattr); | 381 | client = nfs4_proc_lookup_mountpoint(dir, name, fh, fattr); |
378 | dput(parent); | 382 | dput(parent); |
379 | if (IS_ERR(client)) | 383 | if (IS_ERR(client)) |
380 | return ERR_CAST(client); | 384 | return ERR_CAST(client); |
381 | 385 | ||
382 | if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) | 386 | if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) { |
383 | mnt = nfs_do_refmount(client, dentry); | 387 | mnt = nfs_do_refmount(client, dentry); |
384 | else | 388 | goto out; |
385 | mnt = nfs_do_submount(dentry, fh, fattr, client->cl_auth->au_flavor); | 389 | } |
386 | 390 | ||
391 | if (client->cl_auth->au_flavor != flavor) | ||
392 | flavor = client->cl_auth->au_flavor; | ||
393 | else if (!(server->flags & NFS_MOUNT_SECFLAVOUR)) { | ||
394 | rpc_authflavor_t new = nfs4_negotiate_security(dir, name); | ||
395 | if ((int)new >= 0) | ||
396 | flavor = new; | ||
397 | } | ||
398 | mnt = nfs_do_submount(dentry, fh, fattr, flavor); | ||
399 | out: | ||
387 | rpc_shutdown_client(client); | 400 | rpc_shutdown_client(client); |
388 | return mnt; | 401 | return mnt; |
389 | } | 402 | } |