Skip to content

Commit bf97293

Browse files
committed
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 ...
2 parents 16d70e1 + b1b3e13 commit bf97293

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4504
-974
lines changed

Documentation/kernel-parameters.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
18981898
will be sent.
18991899
The default is to send the implementation identification
19001900
information.
1901+
1902+
nfs.recover_lost_locks =
1903+
[NFSv4] Attempt to recover locks that were lost due
1904+
to a lease timeout on the server. Please note that
1905+
doing this risks data corruption, since there are
1906+
no guarantees that the file will remain unchanged
1907+
after the locks are lost.
1908+
If you want to enable the kernel legacy behaviour of
1909+
attempting to recover these locks, then set this
1910+
parameter to '1'.
1911+
The default parameter value of '0' causes the kernel
1912+
not to attempt recovery of lost locks.
19011913

19021914
nfsd.nfs4_disable_idmapping=
19031915
[NFSv4] When set to the default of '1', the NFSv4

fs/nfs/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
obj-$(CONFIG_NFS_FS) += nfs.o
66

7+
CFLAGS_nfstrace.o += -I$(src)
78
nfs-y := client.o dir.o file.o getroot.o inode.o super.o \
89
direct.o pagelist.o read.o symlink.o unlink.o \
9-
write.o namespace.o mount_clnt.o
10+
write.o namespace.o mount_clnt.o nfstrace.o
1011
nfs-$(CONFIG_ROOT_NFS) += nfsroot.o
1112
nfs-$(CONFIG_SYSCTL) += sysctl.o
1213
nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o
@@ -19,12 +20,14 @@ nfsv3-y := nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o
1920
nfsv3-$(CONFIG_NFS_V3_ACL) += nfs3acl.o
2021

2122
obj-$(CONFIG_NFS_V4) += nfsv4.o
23+
CFLAGS_nfs4trace.o += -I$(src)
2224
nfsv4-y := nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o nfs4super.o nfs4file.o \
2325
delegation.o idmap.o callback.o callback_xdr.o callback_proc.o \
24-
nfs4namespace.o nfs4getroot.o nfs4client.o dns_resolve.o
26+
nfs4namespace.o nfs4getroot.o nfs4client.o nfs4session.o \
27+
dns_resolve.o nfs4trace.o
2528
nfsv4-$(CONFIG_NFS_USE_LEGACY_DNS) += cache_lib.o
2629
nfsv4-$(CONFIG_SYSCTL) += nfs4sysctl.o
27-
nfsv4-$(CONFIG_NFS_V4_1) += nfs4session.o pnfs.o pnfs_dev.o
30+
nfsv4-$(CONFIG_NFS_V4_1) += pnfs.o pnfs_dev.o
2831

2932
obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o
3033
nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o

fs/nfs/callback_proc.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "internal.h"
1616
#include "pnfs.h"
1717
#include "nfs4session.h"
18+
#include "nfs4trace.h"
1819

1920
#ifdef NFS_DEBUG
2021
#define NFSDBG_FACILITY NFSDBG_CALLBACK
@@ -93,6 +94,7 @@ __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy,
9394
default:
9495
res = htonl(NFS4ERR_RESOURCE);
9596
}
97+
trace_nfs4_recall_delegation(inode, -ntohl(res));
9698
iput(inode);
9799
out:
98100
dprintk("%s: exit with status = %d\n", __func__, ntohl(res));
@@ -301,14 +303,14 @@ validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args)
301303
{
302304
struct nfs4_slot *slot;
303305

304-
dprintk("%s enter. slotid %d seqid %d\n",
306+
dprintk("%s enter. slotid %u seqid %u\n",
305307
__func__, args->csa_slotid, args->csa_sequenceid);
306308

307309
if (args->csa_slotid >= NFS41_BC_MAX_CALLBACKS)
308310
return htonl(NFS4ERR_BADSLOT);
309311

310312
slot = tbl->slots + args->csa_slotid;
311-
dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr);
313+
dprintk("%s slot table seqid: %u\n", __func__, slot->seq_nr);
312314

313315
/* Normal */
314316
if (likely(args->csa_sequenceid == slot->seq_nr + 1)) {
@@ -318,7 +320,7 @@ validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args)
318320

319321
/* Replay */
320322
if (args->csa_sequenceid == slot->seq_nr) {
321-
dprintk("%s seqid %d is a replay\n",
323+
dprintk("%s seqid %u is a replay\n",
322324
__func__, args->csa_sequenceid);
323325
/* Signal process_op to set this error on next op */
324326
if (args->csa_cachethis == 0)
@@ -462,6 +464,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
462464
} else
463465
res->csr_status = status;
464466

467+
trace_nfs4_cb_sequence(args, res, status);
465468
dprintk("%s: exit with status = %d res->csr_status %d\n", __func__,
466469
ntohl(status), ntohl(res->csr_status));
467470
return status;
@@ -518,7 +521,7 @@ __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy,
518521
if (!cps->clp) /* set in cb_sequence */
519522
goto out;
520523

521-
dprintk_rcu("NFS: CB_RECALL_SLOT request from %s target highest slotid %d\n",
524+
dprintk_rcu("NFS: CB_RECALL_SLOT request from %s target highest slotid %u\n",
522525
rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR),
523526
args->crsa_target_highest_slotid);
524527

fs/nfs/client.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,7 @@ nfs_get_client(const struct nfs_client_initdata *cl_init,
501501
&nn->nfs_client_list);
502502
spin_unlock(&nn->nfs_client_lock);
503503
new->cl_flags = cl_init->init_flags;
504-
return rpc_ops->init_client(new, timeparms, ip_addr,
505-
authflavour);
504+
return rpc_ops->init_client(new, timeparms, ip_addr);
506505
}
507506

508507
spin_unlock(&nn->nfs_client_lock);
@@ -694,13 +693,12 @@ EXPORT_SYMBOL_GPL(nfs_init_server_rpcclient);
694693
* @clp: nfs_client to initialise
695694
* @timeparms: timeout parameters for underlying RPC transport
696695
* @ip_addr: IP presentation address (not used)
697-
* @authflavor: authentication flavor for underlying RPC transport
698696
*
699697
* Returns pointer to an NFS client, or an ERR_PTR value.
700698
*/
701699
struct nfs_client *nfs_init_client(struct nfs_client *clp,
702700
const struct rpc_timeout *timeparms,
703-
const char *ip_addr, rpc_authflavor_t authflavour)
701+
const char *ip_addr)
704702
{
705703
int error;
706704

fs/nfs/delegation.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "nfs4_fs.h"
2121
#include "delegation.h"
2222
#include "internal.h"
23+
#include "nfs4trace.h"
2324

2425
static void nfs_free_delegation(struct nfs_delegation *delegation)
2526
{
@@ -160,6 +161,7 @@ void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred,
160161
spin_unlock(&delegation->lock);
161162
put_rpccred(oldcred);
162163
rcu_read_unlock();
164+
trace_nfs4_reclaim_delegation(inode, res->delegation_type);
163165
} else {
164166
/* We appear to have raced with a delegation return. */
165167
spin_unlock(&delegation->lock);
@@ -344,6 +346,7 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
344346
spin_lock(&inode->i_lock);
345347
nfsi->cache_validity |= NFS_INO_REVAL_FORCED;
346348
spin_unlock(&inode->i_lock);
349+
trace_nfs4_set_delegation(inode, res->delegation_type);
347350

348351
out:
349352
spin_unlock(&clp->cl_lock);

0 commit comments

Comments
 (0)