Skip to content

Commit ecf8402

Browse files
trondmyamschuma-ntap
authored andcommitted
pNFS: When updating the stateid in layoutreturn, also update the recall range
When we update the layout stateid in nfs4_layoutreturn_refresh_stateid, we should also update the range in order to let the server know we're actually returning everything. Fixes: 16c278dbfa63 ("pnfs: Fix handling of NFS4ERR_OLD_STATEID replies...") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 8618289 commit ecf8402

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

fs/nfs/nfs4proc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,6 +3263,7 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
32633263
break;
32643264
case -NFS4ERR_OLD_STATEID:
32653265
if (nfs4_layoutreturn_refresh_stateid(&calldata->arg.lr_args->stateid,
3266+
&calldata->arg.lr_args->range,
32663267
calldata->inode))
32673268
goto lr_restart;
32683269
/* Fallthrough */
@@ -6001,6 +6002,7 @@ static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)
60016002
break;
60026003
case -NFS4ERR_OLD_STATEID:
60036004
if (nfs4_layoutreturn_refresh_stateid(&data->args.lr_args->stateid,
6005+
&data->args.lr_args->range,
60046006
data->inode))
60056007
goto lr_restart;
60066008
/* Fallthrough */
@@ -8952,6 +8954,7 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
89528954
switch (task->tk_status) {
89538955
case -NFS4ERR_OLD_STATEID:
89548956
if (nfs4_layoutreturn_refresh_stateid(&lrp->args.stateid,
8957+
&lrp->args.range,
89558958
lrp->args.inode))
89568959
goto out_restart;
89578960
/* Fallthrough */

fs/nfs/pnfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ pnfs_clear_lseg_state(struct pnfs_layout_segment *lseg,
361361
/*
362362
* Update the seqid of a layout stateid
363363
*/
364-
bool nfs4_layoutreturn_refresh_stateid(nfs4_stateid *dst, struct inode *inode)
364+
bool nfs4_layoutreturn_refresh_stateid(nfs4_stateid *dst,
365+
struct pnfs_layout_range *dst_range,
366+
struct inode *inode)
365367
{
366368
struct pnfs_layout_hdr *lo;
367369
struct pnfs_layout_range range = {
@@ -379,6 +381,7 @@ bool nfs4_layoutreturn_refresh_stateid(nfs4_stateid *dst, struct inode *inode)
379381
err = pnfs_mark_matching_lsegs_return(lo, &head, &range, 0);
380382
if (err != -EBUSY) {
381383
dst->seqid = lo->plh_stateid.seqid;
384+
*dst_range = range;
382385
ret = true;
383386
}
384387
}

fs/nfs/pnfs.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ int pnfs_destroy_layouts_byfsid(struct nfs_client *clp,
259259
bool is_recall);
260260
int pnfs_destroy_layouts_byclid(struct nfs_client *clp,
261261
bool is_recall);
262-
bool nfs4_layoutreturn_refresh_stateid(nfs4_stateid *dst, struct inode *inode);
262+
bool nfs4_layoutreturn_refresh_stateid(nfs4_stateid *dst,
263+
struct pnfs_layout_range *dst_range,
264+
struct inode *inode);
263265
void pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo);
264266
void pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo,
265267
const nfs4_stateid *new,
@@ -781,6 +783,7 @@ static inline void nfs4_pnfs_v3_ds_connect_unload(void)
781783
}
782784

783785
static inline bool nfs4_layoutreturn_refresh_stateid(nfs4_stateid *dst,
786+
struct pnfs_layout_range *dst_range,
784787
struct inode *inode)
785788
{
786789
return false;

0 commit comments

Comments
 (0)