2019-07-18 20:25:35

by Trond Myklebust

[permalink] [raw]
Subject: [GIT PULL] Please pull NFS changes for Linux 5.3

Hi Linus,

The following changes since commit bcc0e65f47def010d8d1c4cf09bdc698fe061b77:

Merge tag 'mips_fixes_5.2_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux (2019-07-06 10:32:12 -0700)

are available in the Git repository at:

git://git.linux-nfs.org/projects/trondmy/linux-nfs.git tags/nfs-for-5.3-1

for you to fetch changes up to d5b9216fd5114be4ed98ca9c1ecc5f164cd8cf5e:

pnfs/flexfiles: Add tracepoints for detecting pnfs fallback to MDS (2019-07-18 15:50:28 -0400)

----------------------------------------------------------------
NFS client updates for Linux 5.3

Highlights include:

Stable fixes:
- SUNRPC: Ensure bvecs are re-synced when we re-encode the RPC request
- Fix an Oops in ff_layout_track_ds_error due to a PTR_ERR() dereference
- Revert buggy NFS readdirplus optimisation
- NFSv4: Handle the special Linux file open access mode
- pnfs: Fix a problem where we gratuitously start doing I/O through the MDS

Features:
- Allow NFS client to set up multiple TCP connections to the server using
a new 'nconnect=X' mount option. Queue length is used to balance load.
- Enhance statistics reporting to report on all transports when using
multiple connections.
- Speed up SUNRPC by removing bh-safe spinlocks
- Add a mechanism to allow NFSv4 to request that containers set a
unique per-host identifier for when the hostname is not set.
- Ensure NFSv4 updates the lease_time after a clientid update

Bugfixes and cleanup:
- Fix use-after-free in rpcrdma_post_recvs
- Fix a memory leak when nfs_match_client() is interrupted
- Fix buggy file access checking in NFSv4 open for execute
- disable unsupported client side deduplication
- Fix spurious client disconnections
- Fix occasional RDMA transport deadlock
- Various RDMA cleanups
- Various tracepoint fixes
- Fix the TCP callback channel to guarantee the server can actually send
the number of callback requests that was negotiated at mount time.

----------------------------------------------------------------
Anna Schumaker (1):
SUNRPC: Drop redundant CONFIG_ from CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES

Benjamin Coddington (1):
NFS: Cleanup if nfs_match_client is interrupted

Chuck Lever (19):
xprtrdma: Fix a BUG when tracing is enabled with NFSv4.1 on RDMA
xprtrdma: Fix use-after-free in rpcrdma_post_recvs
xprtrdma: Replace use of xdr_stream_pos in rpcrdma_marshal_req
xprtrdma: Fix occasional transport deadlock
xprtrdma: Remove the RPCRDMA_REQ_F_PENDING flag
xprtrdma: Remove fr_state
xprtrdma: Add mechanism to place MRs back on the free list
xprtrdma: Reduce context switching due to Local Invalidation
xprtrdma: Wake RPCs directly in rpcrdma_wc_send path
xprtrdma: Simplify rpcrdma_rep_create
xprtrdma: Streamline rpcrdma_post_recvs
xprtrdma: Refactor chunk encoding
xprtrdma: Remove rpcrdma_req::rl_buffer
xprtrdma: Modernize ops->connect
NFS4: Add a trace event to record invalid CB sequence IDs
NFS: Fix show_nfs_errors macros again
NFS: Display symbolic status code names in trace log
NFS: Update symbolic flags displayed by trace events
NFS: Record task, client ID, and XID in xdr_status trace points

Darrick J. Wong (1):
nfs: disable client side deduplication

Dave Wysochanski (5):
SUNRPC: Move call to rpc_count_iostats before rpc_call_done
SUNRPC: Use proper printk specifiers for unsigned long long
SUNRPC: Count ops completing with tk_status < 0
NFSv4: Add lease_time and lease_expired to 'nfs4:' line of mountstats
SUNRPC: Fix possible autodisconnect during connect due to old last_used

Donald Buczek (4):
nfs: Fix copy-and-paste error in debug message
nfs4: Make nfs4_proc_get_lease_time available for nfs4.0
nfs4: Rename nfs41_setup_state_renewal
nfs4.0: Refetch lease_time after clientid update

Markus Elfring (2):
NFS: Use seq_putc() in nfs_show_stats()
NFS: Replace 16 seq_printf() calls by seq_puts()

Max Kellermann (1):
Revert "NFS: readdirplus optimization by cache mechanism" (memleak)

NeilBrown (3):
NFS: send state management on a single connection.
SUNRPC: enhance rpc_clnt_show_stats() to report on all xprts.
SUNRPC: add links for all client xprts to debugfs

Trond Myklebust (36):
NFSv4: Handle open for execute correctly
NFSv4: Handle the special Linux file open access mode
SUNRPC: Replace the queue timer with a delayed work function
SUNRPC: Replace direct task wakeups from softirq context
SUNRPC: Remove the bh-safe lock requirement on xprt->transport_lock
NFS: Create a root NFS directory in /sys/fs/nfs
NFS: Cleanup - add nfs_clients_exit to mirror nfs_clients_init
SUNRPC: Add basic load balancing to the transport switch
SUNRPC: Remove the bh-safe lock requirement on the rpc_wait_queue->lock
NFS: Add deferred cache invalidation for close-to-open consistency violations
NFS: Add sysfs support for per-container identifier
SUNRPC: Allow creation of RPC clients with multiple connections
NFS: Add a mount option to specify number of TCP connections to use
NFSv4: Allow multiple connections to NFSv4.x (x>0) servers
pNFS: Allow multiple connections to the DS
NFS: Display the "nconnect" mount option if it is set.
NFS: Allow multiple connections to a NFSv2 or NFSv3 server
Merge branch 'bh-remove'
SUNRPC: Remove warning in debugfs.c when compiling with W=1
Merge branch 'cache_consistency'
Merge branch 'containers'
Merge branch 'multipath_tcp'
NFS: Clean up writeback code
Merge tag 'nfs-rdma-for-5.3-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
SUNRPC: Fix transport accounting when caller specifies an rpc_xprt
NFSv4: Validate the stateid before applying it to state recovery
SUNRPC: Replace division by multiplication in calculation of queue length
SUNRPC: Skip zero-refcount transports
SUNRPC: Fix initialisation of struct rpc_xprt_switch
SUNRPC: Fix up backchannel slot table accounting
NFSv4: Don't use the zero stateid with layoutget
pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error
SUNRPC: Ensure the bvecs are reset when we re-encode the RPC request
SUNRPC: Optimise transport balancing code
pnfs: Fix a problem where we gratuitously start doing I/O through the MDS
pnfs/flexfiles: Add tracepoints for detecting pnfs fallback to MDS

fs/nfs/Makefile | 3 +-
fs/nfs/callback_proc.c | 28 ++-
fs/nfs/client.c | 24 ++-
fs/nfs/dir.c | 94 +--------
fs/nfs/flexfilelayout/flexfilelayout.c | 26 +++
fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +-
fs/nfs/inode.c | 30 ++-
fs/nfs/internal.h | 7 +-
fs/nfs/netns.h | 3 +
fs/nfs/nfs2xdr.c | 2 +-
fs/nfs/nfs3client.c | 3 +
fs/nfs/nfs3xdr.c | 2 +-
fs/nfs/nfs4_fs.h | 4 +-
fs/nfs/nfs4client.c | 14 +-
fs/nfs/nfs4file.c | 8 +-
fs/nfs/nfs4proc.c | 80 +++++--
fs/nfs/nfs4state.c | 49 +++--
fs/nfs/nfs4trace.c | 8 +
fs/nfs/nfs4trace.h | 283 ++++++++++++++++++-------
fs/nfs/nfs4xdr.c | 16 +-
fs/nfs/nfstrace.h | 233 ++++++++++++++------
fs/nfs/pagelist.c | 6 +-
fs/nfs/pnfs.c | 20 +-
fs/nfs/super.c | 57 +++--
fs/nfs/sysfs.c | 187 +++++++++++++++++
fs/nfs/sysfs.h | 25 +++
fs/nfs/write.c | 7 +-
include/linux/nfs4.h | 1 +
include/linux/nfs_fs.h | 2 +
include/linux/nfs_fs_sb.h | 1 +
include/linux/sunrpc/bc_xprt.h | 1 +
include/linux/sunrpc/clnt.h | 4 +
include/linux/sunrpc/metrics.h | 7 +-
include/linux/sunrpc/sched.h | 4 +-
include/linux/sunrpc/xprt.h | 10 +-
include/linux/sunrpc/xprtmultipath.h | 2 +
include/linux/sunrpc/xprtsock.h | 5 +
include/trace/events/rpcrdma.h | 90 ++++++--
net/sunrpc/Kconfig | 2 +-
net/sunrpc/backchannel_rqst.c | 40 ++--
net/sunrpc/clnt.c | 95 ++++++++-
net/sunrpc/debugfs.c | 48 +++--
net/sunrpc/sched.c | 81 ++++---
net/sunrpc/stats.c | 23 +-
net/sunrpc/svc.c | 2 +-
net/sunrpc/xprt.c | 101 +++++----
net/sunrpc/xprtmultipath.c | 89 ++++++--
net/sunrpc/xprtrdma/backchannel.c | 7 +
net/sunrpc/xprtrdma/frwr_ops.c | 327 +++++++++++++++++++----------
net/sunrpc/xprtrdma/rpc_rdma.c | 152 ++++++--------
net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 4 +-
net/sunrpc/xprtrdma/svc_rdma_transport.c | 8 +-
net/sunrpc/xprtrdma/transport.c | 84 ++++++--
net/sunrpc/xprtrdma/verbs.c | 115 +++++-----
net/sunrpc/xprtrdma/xprt_rdma.h | 45 ++--
net/sunrpc/xprtsock.c | 126 +++++++----
56 files changed, 1832 insertions(+), 865 deletions(-)
create mode 100644 fs/nfs/sysfs.c
create mode 100644 fs/nfs/sysfs.h
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]



2019-07-18 21:48:45

by Linus Torvalds

[permalink] [raw]
Subject: Re: [GIT PULL] Please pull NFS changes for Linux 5.3

On Thu, Jul 18, 2019 at 1:25 PM Trond Myklebust <[email protected]> wrote:
>
> git://git.linux-nfs.org/projects/trondmy/linux-nfs.git tags/nfs-for-5.3-1

This got a conflict with the debugfs "don't behave differently on
failures" changes in net/sunrpc/debugfs.c.

See commit 0a0762c6c604 ("sunrpc: no need to check return value of
debugfs_create functions") by Greg, but I suspect you were already
aware of this.

I did a hack-and-slash "remove the error handling", and the end result
looks sane. Except I left the "if the snprintf overflows" error
handling in place, even if nothing then cares about the returned
error.

I think my merge resolution makes sense, but I thought I'd mention it
in case you had something else in mind. Honestly, the snprintf()
checks in do_xprt_debugfs() look kind o fpointless, but the comment is
also wrong:

char link[9]; /* enough for 8 hex digits + NULL */

that comment was copied from the "name[]" array in
rpc_clnt_debugfs_register(), but it's bogus, since you actually use

len = snprintf(link, sizeof(link), "xprt%d", *nump);

on the thing.

And you know what? If you have so many links that "xprt%d" doesn't fit
in 8 chars plus NUL, maybe you don't really care?

But it's also worth noting that the whole snprintf() overflow check is
*wrong* to begin with. When you do

if (len > sizeof(link))
return -1;

you're testing the wrong thing entirely. The returned "len" is the
length that would have been printed _without_ the ending NUL
character, so you actually had a truncation even if it returns
"sizeof(link)" - because then the NUL character was written instead of
the last character.

So the overflow test *should* have been

if (len >= sizeof(link))
return -1;

but I suspect the correct thing to do is to just say "we don't care"
and remove that error check entirely. Same goes for the other case
("len > sizeof(name)").

At some point error handling doesn't actually add value, as long as
the error itself isn't fatal. And when the error handling itself is
wrong, it's doubly suspect.

But as mentioned, I did *not* remove this part of the error handling.
I only removed the debugfs parts. The error handling may be wrong, but
it is what it is, and it doesn't really matter.

Linus

2019-07-18 22:05:23

by pr-tracker-bot

[permalink] [raw]
Subject: Re: [GIT PULL] Please pull NFS changes for Linux 5.3

The pull request you sent on Thu, 18 Jul 2019 20:25:03 +0000:

> git://git.linux-nfs.org/projects/trondmy/linux-nfs.git tags/nfs-for-5.3-1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6860c981b9672324cb53b883cfda8d2ea1445ff1

Thank you!

--
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker