Skip to content

Commit 2ec20f4

Browse files
committed
Merge tag 'nfs-for-5.16-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Highlights include: Features: - NFSv4.1 can always retrieve and cache the ACCESS mode on OPEN - Optimisations for READDIR and the 'ls -l' style workload - Further replacements of dprintk() with tracepoints and other tracing improvements - Ensure we re-probe NFSv4 server capabilities when the user does a "mount -o remount" Bugfixes: - Fix an Oops in pnfs_mark_request_commit() - Fix up deadlocks in the commit code - Fix regressions in NFSv2/v3 attribute revalidation due to the change_attr_type optimisations - Fix some dentry verifier races - Fix some missing dentry verifier settings - Fix a performance regression in nfs_set_open_stateid_locked() - SUNRPC was sending multiple SYN calls when re-establishing a TCP connection. - Fix multiple NFSv4 issues due to missing sanity checking of server return values - Fix a potential Oops when FREE_STATEID races with an unmount Cleanups: - Clean up the labelled NFS code - Remove unused header <linux/pnfs_osd_xdr.h>" * tag 'nfs-for-5.16-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (84 commits) NFSv4: Sanity check the parameters in nfs41_update_target_slotid() NFS: Remove the nfs4_label argument from decode_getattr_*() functions NFS: Remove the nfs4_label argument from nfs_setsecurity NFS: Remove the nfs4_label argument from nfs_fhget() NFS: Remove the nfs4_label argument from nfs_add_or_obtain() NFS: Remove the nfs4_label argument from nfs_instantiate() NFS: Remove the nfs4_label from the nfs_setattrres NFS: Remove the nfs4_label from the nfs4_getattr_res NFS: Remove the f_label from the nfs4_opendata and nfs_openres NFS: Remove the nfs4_label from the nfs4_lookupp_res struct NFS: Remove the label from the nfs4_lookup_res struct NFS: Remove the nfs4_label from the nfs4_link_res struct NFS: Remove the nfs4_label from the nfs4_create_res struct NFS: Remove the nfs4_label from the nfs_entry struct NFS: Create a new nfs_alloc_fattr_with_label() function NFS: Always initialise fattr->label in nfs_fattr_alloc() NFSv4.2: alloc_file_pseudo() takes an open flag, not an f_mode NFS: Don't allocate nfs_fattr on the stack in __nfs42_ssc_open() NFSv4: Remove unnecessary 'minor version' check NFSv4: Fix potential Oops in decode_op_map() ...
2 parents 5147da9 + f96f8cc commit 2ec20f4

Some content is hidden

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

59 files changed

+2011
-1814
lines changed

fs/lockd/clntproc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,6 @@ static void nlmclnt_cancel_callback(struct rpc_task *task, void *data)
794794
goto retry_cancel;
795795
}
796796

797-
dprintk("lockd: cancel status %u (task %u)\n",
798-
status, task->tk_pid);
799-
800797
switch (status) {
801798
case NLM_LCK_GRANTED:
802799
case NLM_LCK_DENIED_GRACE_PERIOD:

fs/lockd/svc4proc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ nlm4svc_proc_granted(struct svc_rqst *rqstp)
269269
*/
270270
static void nlm4svc_callback_exit(struct rpc_task *task, void *data)
271271
{
272-
dprintk("lockd: %5u callback returned %d\n", task->tk_pid,
273-
-task->tk_status);
274272
}
275273

276274
static void nlm4svc_callback_release(void *data)

fs/lockd/svcproc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ nlmsvc_proc_granted(struct svc_rqst *rqstp)
301301
*/
302302
static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
303303
{
304-
dprintk("lockd: %5u callback returned %d\n", task->tk_pid,
305-
-task->tk_status);
306304
}
307305

308306
void nlmsvc_release_call(struct nlm_rqst *call)

fs/nfs/callback_proc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,9 @@ __be32 nfs4_callback_offload(void *data, void *dummy,
739739
kfree(copy);
740740
spin_unlock(&cps->clp->cl_lock);
741741

742+
trace_nfs4_cb_offload(&args->coa_fh, &args->coa_stateid,
743+
args->wr_count, args->error,
744+
args->wr_writeverf.committed);
742745
return 0;
743746
}
744747
#endif /* CONFIG_NFS_V4_2 */

fs/nfs/client.c

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ static void nfs_server_set_fsinfo(struct nfs_server *server,
828828
/*
829829
* Probe filesystem information, including the FSID on v2/v3
830830
*/
831-
int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs_fattr *fattr)
831+
static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs_fattr *fattr)
832832
{
833833
struct nfs_fsinfo fsinfo;
834834
struct nfs_client *clp = server->nfs_client;
@@ -862,7 +862,30 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs
862862

863863
return 0;
864864
}
865-
EXPORT_SYMBOL_GPL(nfs_probe_fsinfo);
865+
866+
/*
867+
* Grab the destination's particulars, including lease expiry time.
868+
*
869+
* Returns zero if probe succeeded and retrieved FSID matches the FSID
870+
* we have cached.
871+
*/
872+
int nfs_probe_server(struct nfs_server *server, struct nfs_fh *mntfh)
873+
{
874+
struct nfs_fattr *fattr;
875+
int error;
876+
877+
fattr = nfs_alloc_fattr();
878+
if (fattr == NULL)
879+
return -ENOMEM;
880+
881+
/* Sanity: the probe won't work if the destination server
882+
* does not recognize the migrated FH. */
883+
error = nfs_probe_fsinfo(server, mntfh, fattr);
884+
885+
nfs_free_fattr(fattr);
886+
return error;
887+
}
888+
EXPORT_SYMBOL_GPL(nfs_probe_server);
866889

867890
/*
868891
* Copy useful information when duplicating a server record
@@ -1025,7 +1048,7 @@ struct nfs_server *nfs_create_server(struct fs_context *fc)
10251048

10261049
if (!(fattr->valid & NFS_ATTR_FATTR)) {
10271050
error = ctx->nfs_mod->rpc_ops->getattr(server, ctx->mntfh,
1028-
fattr, NULL, NULL);
1051+
fattr, NULL);
10291052
if (error < 0) {
10301053
dprintk("nfs_create_server: getattr error = %d\n", -error);
10311054
goto error;
@@ -1058,7 +1081,6 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
10581081
rpc_authflavor_t flavor)
10591082
{
10601083
struct nfs_server *server;
1061-
struct nfs_fattr *fattr_fsinfo;
10621084
int error;
10631085

10641086
server = nfs_alloc_server();
@@ -1067,11 +1089,6 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
10671089

10681090
server->cred = get_cred(source->cred);
10691091

1070-
error = -ENOMEM;
1071-
fattr_fsinfo = nfs_alloc_fattr();
1072-
if (fattr_fsinfo == NULL)
1073-
goto out_free_server;
1074-
10751092
/* Copy data from the source */
10761093
server->nfs_client = source->nfs_client;
10771094
server->destroy = source->destroy;
@@ -1087,7 +1104,7 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
10871104
goto out_free_server;
10881105

10891106
/* probe the filesystem info for this server filesystem */
1090-
error = nfs_probe_fsinfo(server, fh, fattr_fsinfo);
1107+
error = nfs_probe_server(server, fh);
10911108
if (error < 0)
10921109
goto out_free_server;
10931110

@@ -1101,11 +1118,9 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
11011118
nfs_server_insert_lists(server);
11021119
server->mount_time = jiffies;
11031120

1104-
nfs_free_fattr(fattr_fsinfo);
11051121
return server;
11061122

11071123
out_free_server:
1108-
nfs_free_fattr(fattr_fsinfo);
11091124
nfs_free_server(server);
11101125
return ERR_PTR(error);
11111126
}

fs/nfs/delegation.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,13 @@ int nfs4_inode_return_delegation(struct inode *inode)
755755
struct nfs_delegation *delegation;
756756

757757
delegation = nfs_start_delegation_return(nfsi);
758-
/* Synchronous recall of any application leases */
759-
break_lease(inode, O_WRONLY | O_RDWR);
760-
nfs_wb_all(inode);
761-
if (delegation != NULL)
758+
if (delegation != NULL) {
759+
/* Synchronous recall of any application leases */
760+
break_lease(inode, O_WRONLY | O_RDWR);
761+
if (S_ISREG(inode->i_mode))
762+
nfs_wb_all(inode);
762763
return nfs_end_delegation_return(inode, delegation, 1);
764+
}
763765
return 0;
764766
}
765767

0 commit comments

Comments
 (0)