Skip to content

Commit 7140171

Browse files
committed
NFSv4.1/pnfs: Ensure we send layoutcommit before return-on-close
We must not send a close or delegreturn that would result in a return-on-close of the layout without ensuring that we've also sent the necessary layoutcommit. Signed-off-by: Trond Myklebust <[email protected]>
1 parent a0815d5 commit 7140171

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/nfs/pnfs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,7 @@ bool pnfs_roc(struct inode *ino)
10901090
pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */
10911091
spin_unlock(&ino->i_lock);
10921092
pnfs_free_lseg_list(&tmp_list);
1093+
pnfs_layoutcommit_inode(ino, true);
10931094
return true;
10941095

10951096
out_noroc:
@@ -1104,8 +1105,10 @@ bool pnfs_roc(struct inode *ino)
11041105
}
11051106
}
11061107
spin_unlock(&ino->i_lock);
1107-
if (layoutreturn)
1108+
if (layoutreturn) {
1109+
pnfs_layoutcommit_inode(ino, true);
11081110
pnfs_send_layoutreturn(lo, stateid, IOMODE_ANY, true);
1111+
}
11091112
return false;
11101113
}
11111114

0 commit comments

Comments
 (0)