@@ -691,7 +691,7 @@ struct super_block *
nfs4_lock_state();
fp = find_alloc_file(ino, lgp->lg_fhp);
- clp = find_confirmed_client((clientid_t *)&lgp->lg_seg.clientid, true,
+ clp = find_confirmed_client(&lgp->lg_clientid, true,
net_generic(SVC_NET(rqstp), nfsd_net_id));
dprintk("pNFS %s: fp %p clp %p\n", __func__, fp, clp);
if (!fp || !clp) {
@@ -718,10 +718,13 @@ struct super_block *
goto out_unlock;
}
+ memcpy(&args.lg_sid, &lgp->lg_sid, sizeof(args.lg_sid));
+
dprintk("pNFS %s: pre-export type 0x%x maxcount %Zd "
- "iomode %u offset %llu length %llu\n",
+ "ls %p stateid " STATEID_FMT " iomode %u offset %llu length %llu\n",
__func__, lgp->lg_seg.layout_type,
exp_xdr_qbytes(xdr->end - xdr->p),
+ ls, STATEID_VAL(&lgp->lg_sid),
lgp->lg_seg.iomode, lgp->lg_seg.offset, lgp->lg_seg.length);
/* FIXME: need to eliminate the use of the state lock */
@@ -1193,9 +1193,8 @@ static int fill_in_write_vector(struct kvec *vec, struct nfsd4_write *write)
goto out;
}
- /* Set up arguments so layout can be retrieved at encode time */
lgp->lg_fhp = current_fh;
- copy_clientid((clientid_t *)&lgp->lg_seg.clientid, cstate->session);
+ copy_clientid(&lgp->lg_clientid, cstate->session);
status = nfs_ok;
out:
return status;
@@ -452,6 +452,7 @@ struct nfsd4_pnfs_layoutget {
stateid_t lg_sid; /* request/response */
struct nfsd4_layout_seg lg_seg; /* request/response */
u32 lg_roc; /* response */
+ clientid_t lg_clientid;
};
struct nfsd4_pnfs_layoutcommit {
@@ -81,6 +81,7 @@ struct nfsd4_pnfs_layoutget_arg {
u64 lg_minlength;
u64 lg_sbid;
const struct knfsd_fh *lg_fh;
+ nfs4_stateid lg_sid;
};
struct nfsd4_pnfs_layoutget_res {
rather than the clientid which is deprecated from the fs pnfs api Signed-off-by: Benny Halevy <bhalevy@tonian.com> --- fs/nfsd/nfs4pnfsd.c | 7 +++++-- fs/nfsd/nfs4proc.c | 3 +-- fs/nfsd/xdr4.h | 1 + include/linux/nfsd/nfsd4_pnfs.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-)