Skip to content

Commit 965181d

Browse files
committed
Merge tag 'nfs-for-5.18-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Highlights include: Features: - Switch NFS to use readahead instead of the obsolete readpages. - Readdir fixes to improve cacheability of large directories when there are multiple readers and writers. - Readdir performance improvements when doing a seekdir() immediately after opening the directory (common when re-exporting NFS). - NFS swap improvements from Neil Brown. - Loosen up memory allocation to permit direct reclaim and write back in cases where there is no danger of deadlocking the writeback code or NFS swap. - Avoid sillyrename when the NFSv4 server claims to support the necessary features to recover the unlinked but open file after reboot. Bugfixes: - Patch from Olga to add a mount option to control NFSv4.1 session trunking discovery, and default it to being off. - Fix a lockup in nfs_do_recoalesce(). - Two fixes for list iterator variables being used when pointing to the list head. - Fix a kernel memory scribble when reading from a non-socket transport in /sys/kernel/sunrpc. - Fix a race where reconnecting to a server could leave the TCP socket stuck forever in the connecting state. - Patch from Neil to fix a shutdown race which can leave the SUNRPC transport timer primed after we free the struct xprt itself. - Patch from Xin Xiong to fix reference count leaks in the NFSv4.2 copy offload. - Sunrpc patch from Olga to avoid resending a task on an offlined transport. Cleanups: - Patches from Dave Wysochanski to clean up the fscache code" * tag 'nfs-for-5.18-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (91 commits) NFSv4/pNFS: Fix another issue with a list iterator pointing to the head NFS: Don't loop forever in nfs_do_recoalesce() SUNRPC: Don't return error values in sysfs read of closed files SUNRPC: Do not dereference non-socket transports in sysfs NFSv4.1: don't retry BIND_CONN_TO_SESSION on session error SUNRPC don't resend a task on an offlined transport NFS: replace usage of found with dedicated list iterator variable SUNRPC: avoid race between mod_timer() and del_timer_sync() pNFS/files: Ensure pNFS allocation modes are consistent with nfsiod pNFS/flexfiles: Ensure pNFS allocation modes are consistent with nfsiod NFSv4/pnfs: Ensure pNFS allocation modes are consistent with nfsiod NFS: Avoid writeback threads getting stuck in mempool_alloc() NFS: nfsiod should not block forever in mempool_alloc() SUNRPC: Make the rpciod and xprtiod slab allocation modes consistent SUNRPC: Fix unx_lookup_cred() allocation NFS: Fix memory allocation in rpc_alloc_task() NFS: Fix memory allocation in rpc_malloc() SUNRPC: Improve accuracy of socket ENOBUFS determination SUNRPC: Replace internal use of SOCKWQ_ASYNC_NOSPACE SUNRPC: Fix socket waits for write buffer space ...
2 parents 1ec48f9 + 7c9d845 commit 965181d

Some content is hidden

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

60 files changed

+1317
-813
lines changed

fs/nfs/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ config NFS_FS
44
depends on INET && FILE_LOCKING && MULTIUSER
55
select LOCKD
66
select SUNRPC
7+
select CRYPTO
8+
select CRYPTO_HASH
9+
select XXHASH
10+
select CRYPTO_XXHASH
711
select NFS_ACL_SUPPORT if NFS_V3_ACL
812
help
913
Choose Y here if you want to access files residing on other

fs/nfs/callback_proc.c

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -358,36 +358,27 @@ __be32 nfs4_callback_devicenotify(void *argp, void *resp,
358358
struct cb_process_state *cps)
359359
{
360360
struct cb_devicenotifyargs *args = argp;
361+
const struct pnfs_layoutdriver_type *ld = NULL;
361362
uint32_t i;
362363
__be32 res = 0;
363-
struct nfs_client *clp = cps->clp;
364-
struct nfs_server *server = NULL;
365364

366-
if (!clp) {
365+
if (!cps->clp) {
367366
res = cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION);
368367
goto out;
369368
}
370369

371370
for (i = 0; i < args->ndevs; i++) {
372371
struct cb_devicenotifyitem *dev = &args->devs[i];
373372

374-
if (!server ||
375-
server->pnfs_curr_ld->id != dev->cbd_layout_type) {
376-
rcu_read_lock();
377-
list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link)
378-
if (server->pnfs_curr_ld &&
379-
server->pnfs_curr_ld->id == dev->cbd_layout_type) {
380-
rcu_read_unlock();
381-
goto found;
382-
}
383-
rcu_read_unlock();
384-
continue;
373+
if (!ld || ld->id != dev->cbd_layout_type) {
374+
pnfs_put_layoutdriver(ld);
375+
ld = pnfs_find_layoutdriver(dev->cbd_layout_type);
376+
if (!ld)
377+
continue;
385378
}
386-
387-
found:
388-
nfs4_delete_deviceid(server->pnfs_curr_ld, clp, &dev->cbd_dev_id);
379+
nfs4_delete_deviceid(ld, cps->clp, &dev->cbd_dev_id);
389380
}
390-
381+
pnfs_put_layoutdriver(ld);
391382
out:
392383
kfree(args->devs);
393384
return res;
@@ -710,7 +701,7 @@ __be32 nfs4_callback_offload(void *data, void *dummy,
710701
struct nfs4_copy_state *copy, *tmp_copy;
711702
bool found = false;
712703

713-
copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_NOFS);
704+
copy = kzalloc(sizeof(struct nfs4_copy_state), GFP_KERNEL);
714705
if (!copy)
715706
return htonl(NFS4ERR_SERVERFAULT);
716707

fs/nfs/callback_xdr.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,6 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,
271271
n = ntohl(*p++);
272272
if (n == 0)
273273
goto out;
274-
if (n > ULONG_MAX / sizeof(*args->devs)) {
275-
status = htonl(NFS4ERR_BADXDR);
276-
goto out;
277-
}
278274

279275
args->devs = kmalloc_array(n, sizeof(*args->devs), GFP_KERNEL);
280276
if (!args->devs) {

fs/nfs/client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,8 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
857857
}
858858

859859
if (clp->rpc_ops->discover_trunking != NULL &&
860-
(server->caps & NFS_CAP_FS_LOCATIONS)) {
860+
(server->caps & NFS_CAP_FS_LOCATIONS &&
861+
(server->flags & NFS_MOUNT_TRUNK_DISCOVERY))) {
861862
error = clp->rpc_ops->discover_trunking(server, mntfh);
862863
if (error < 0)
863864
return error;

fs/nfs/delegation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ int nfs_inode_set_delegation(struct inode *inode, const struct cred *cred,
439439
struct nfs_delegation *freeme = NULL;
440440
int status = 0;
441441

442-
delegation = kmalloc(sizeof(*delegation), GFP_NOFS);
442+
delegation = kmalloc(sizeof(*delegation), GFP_KERNEL_ACCOUNT);
443443
if (delegation == NULL)
444444
return -ENOMEM;
445445
nfs4_stateid_copy(&delegation->stateid, stateid);

0 commit comments

Comments
 (0)