Recent changes to the waitq code removed the wait for io to drain in the case of a "forgetful" return. Restore the previous behavior. Signed-off-by: Fred Isaman <iisaman@xxxxxxxxxx> --- fs/nfs/nfs4proc.c | 6 +++++- fs/nfs/pnfs.c | 9 +++------ include/linux/nfs_xdr.h | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index c854814..7727f592 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5639,7 +5639,11 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata) rpc_sleep_on(&nfsi->lo_rpcwaitq, task, NULL); return; } - + if (lrp->stateid) { + /* Forget the layout, without sending the return */ + rpc_exit(task, 0); + return; + } if (nfs4_setup_sequence(server, NULL, &lrp->args.seq_args, &lrp->res.seq_res, 0, task)) return; diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index f573219..eb4dfdf 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -612,7 +612,7 @@ pnfs_return_layout_barrier(struct nfs_inode *nfsi, static int return_layout(struct inode *ino, struct pnfs_layout_range *range, enum pnfs_layoutreturn_type type, struct pnfs_layout_hdr *lo, - bool wait) + bool wait, const nfs4_stateid *stateid) { struct nfs4_layoutreturn *lrp; struct nfs_server *server = NFS_SERVER(ino); @@ -633,6 +633,7 @@ return_layout(struct inode *ino, struct pnfs_layout_range *range, lrp->args.return_type = type; lrp->args.range = *range; lrp->args.inode = ino; + lrp->stateid = stateid; status = nfs4_proc_layoutreturn(lrp, wait); out: @@ -688,11 +689,7 @@ _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range, __func__, status); } } - - if (!stateid) - status = return_layout(ino, &arg, type, lo, wait); - else - pnfs_layoutreturn_release(lo, &arg); + status = return_layout(ino, &arg, type, lo, wait, stateid); } out: dprintk("<-- %s status: %d\n", __func__, status); diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index c72de21..80e6a36 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -277,6 +277,7 @@ struct nfs4_layoutreturn { struct nfs4_layoutreturn_args args; struct nfs4_layoutreturn_res res; struct rpc_cred *cred; + const nfs4_stateid *stateid; int rpc_status; }; -- 1.7.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html