Skip to content

Commit 7413927

Browse files
committed
Merge tag 'nfs-for-5.16-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client fixes from Trond Myklebust: "Highlights include: Stable fixes: - NFSv42: Fix pagecache invalidation after COPY/CLONE Bugfixes: - NFSv42: Don't fail clone() just because the server failed to return post-op attributes - SUNRPC: use different lockdep keys for INET6 and LOCAL - NFSv4.1: handle NFS4ERR_NOSPC from CREATE_SESSION - SUNRPC: fix header include guard in trace header" * tag 'nfs-for-5.16-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: SUNRPC: use different lock keys for INET6 and LOCAL sunrpc: fix header include guard in trace header NFSv4.1: handle NFS4ERR_NOSPC by CREATE_SESSION NFSv42: Fix pagecache invalidation after COPY/CLONE NFS: Add a tracepoint to show the results of nfs_set_cache_invalid() NFSv42: Don't fail clone() unless the OP_CLONE operation failed
2 parents 52dc4c6 + 064a917 commit 7413927

File tree

7 files changed

+16
-9
lines changed

7 files changed

+16
-9
lines changed

fs/nfs/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ void nfs_set_cache_invalid(struct inode *inode, unsigned long flags)
219219
NFS_INO_DATA_INVAL_DEFER);
220220
else if (nfsi->cache_validity & NFS_INO_INVALID_DATA)
221221
nfsi->cache_validity &= ~NFS_INO_DATA_INVAL_DEFER;
222+
trace_nfs_set_cache_invalid(inode, 0);
222223
}
223224
EXPORT_SYMBOL_GPL(nfs_set_cache_invalid);
224225

fs/nfs/nfs42proc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ static void nfs42_copy_dest_done(struct inode *inode, loff_t pos, loff_t len)
289289
loff_t newsize = pos + len;
290290
loff_t end = newsize - 1;
291291

292-
truncate_pagecache_range(inode, pos, end);
292+
WARN_ON_ONCE(invalidate_inode_pages2_range(inode->i_mapping,
293+
pos >> PAGE_SHIFT, end >> PAGE_SHIFT));
294+
293295
spin_lock(&inode->i_lock);
294296
if (newsize > i_size_read(inode))
295297
i_size_write(inode, newsize);

fs/nfs/nfs42xdr.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,8 +1434,7 @@ static int nfs4_xdr_dec_clone(struct rpc_rqst *rqstp,
14341434
status = decode_clone(xdr);
14351435
if (status)
14361436
goto out;
1437-
status = decode_getfattr(xdr, res->dst_fattr, res->server);
1438-
1437+
decode_getfattr(xdr, res->dst_fattr, res->server);
14391438
out:
14401439
res->rpc_status = status;
14411440
return status;

fs/nfs/nfs4state.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,6 +1998,10 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status)
19981998
dprintk("%s: exit with error %d for server %s\n",
19991999
__func__, -EPROTONOSUPPORT, clp->cl_hostname);
20002000
return -EPROTONOSUPPORT;
2001+
case -ENOSPC:
2002+
if (clp->cl_cons_state == NFS_CS_SESSION_INITING)
2003+
nfs_mark_client_ready(clp, -EIO);
2004+
return -EIO;
20012005
case -NFS4ERR_NOT_SAME: /* FixMe: implement recovery
20022006
* in nfs4_exchange_id */
20032007
default:

fs/nfs/nfstrace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ DEFINE_NFS_INODE_EVENT_DONE(nfs_writeback_inode_exit);
162162
DEFINE_NFS_INODE_EVENT(nfs_fsync_enter);
163163
DEFINE_NFS_INODE_EVENT_DONE(nfs_fsync_exit);
164164
DEFINE_NFS_INODE_EVENT(nfs_access_enter);
165+
DEFINE_NFS_INODE_EVENT_DONE(nfs_set_cache_invalid);
165166

166167
TRACE_EVENT(nfs_access_exit,
167168
TP_PROTO(

include/trace/events/rpcgss.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#undef TRACE_SYSTEM
99
#define TRACE_SYSTEM rpcgss
1010

11-
#if !defined(_TRACE_RPCRDMA_H) || defined(TRACE_HEADER_MULTI_READ)
11+
#if !defined(_TRACE_RPCGSS_H) || defined(TRACE_HEADER_MULTI_READ)
1212
#define _TRACE_RPCGSS_H
1313

1414
#include <linux/tracepoint.h>

net/sunrpc/xprtsock.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,31 +1720,31 @@ static void xs_local_set_port(struct rpc_xprt *xprt, unsigned short port)
17201720
}
17211721

17221722
#ifdef CONFIG_DEBUG_LOCK_ALLOC
1723-
static struct lock_class_key xs_key[2];
1724-
static struct lock_class_key xs_slock_key[2];
1723+
static struct lock_class_key xs_key[3];
1724+
static struct lock_class_key xs_slock_key[3];
17251725

17261726
static inline void xs_reclassify_socketu(struct socket *sock)
17271727
{
17281728
struct sock *sk = sock->sk;
17291729

17301730
sock_lock_init_class_and_name(sk, "slock-AF_LOCAL-RPC",
1731-
&xs_slock_key[1], "sk_lock-AF_LOCAL-RPC", &xs_key[1]);
1731+
&xs_slock_key[0], "sk_lock-AF_LOCAL-RPC", &xs_key[0]);
17321732
}
17331733

17341734
static inline void xs_reclassify_socket4(struct socket *sock)
17351735
{
17361736
struct sock *sk = sock->sk;
17371737

17381738
sock_lock_init_class_and_name(sk, "slock-AF_INET-RPC",
1739-
&xs_slock_key[0], "sk_lock-AF_INET-RPC", &xs_key[0]);
1739+
&xs_slock_key[1], "sk_lock-AF_INET-RPC", &xs_key[1]);
17401740
}
17411741

17421742
static inline void xs_reclassify_socket6(struct socket *sock)
17431743
{
17441744
struct sock *sk = sock->sk;
17451745

17461746
sock_lock_init_class_and_name(sk, "slock-AF_INET6-RPC",
1747-
&xs_slock_key[1], "sk_lock-AF_INET6-RPC", &xs_key[1]);
1747+
&xs_slock_key[2], "sk_lock-AF_INET6-RPC", &xs_key[2]);
17481748
}
17491749

17501750
static inline void xs_reclassify_socket(int family, struct socket *sock)

0 commit comments

Comments
 (0)