mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 06:34:12 +08:00
pNFS: Mark layout for return if return-on-close was not sent
If the layout return-on-close failed because the layoutreturn was never
sent, then we should mark the layout for return again.
Fixes: 9c47b18cf7
("pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
86b53fbf08
commit
67bbceedc9
@ -1560,12 +1560,18 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args,
|
|||||||
int ret)
|
int ret)
|
||||||
{
|
{
|
||||||
struct pnfs_layout_hdr *lo = args->layout;
|
struct pnfs_layout_hdr *lo = args->layout;
|
||||||
|
struct inode *inode = args->inode;
|
||||||
const nfs4_stateid *arg_stateid = NULL;
|
const nfs4_stateid *arg_stateid = NULL;
|
||||||
const nfs4_stateid *res_stateid = NULL;
|
const nfs4_stateid *res_stateid = NULL;
|
||||||
struct nfs4_xdr_opaque_data *ld_private = args->ld_private;
|
struct nfs4_xdr_opaque_data *ld_private = args->ld_private;
|
||||||
|
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case -NFS4ERR_NOMATCHING_LAYOUT:
|
case -NFS4ERR_NOMATCHING_LAYOUT:
|
||||||
|
spin_lock(&inode->i_lock);
|
||||||
|
if (pnfs_layout_is_valid(lo) &&
|
||||||
|
nfs4_stateid_match_other(&args->stateid, &lo->plh_stateid))
|
||||||
|
pnfs_set_plh_return_info(lo, args->range.iomode, 0);
|
||||||
|
spin_unlock(&inode->i_lock);
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
if (res->lrs_present)
|
if (res->lrs_present)
|
||||||
|
Loading…
Reference in New Issue
Block a user