Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <trond.myklebust@primarydata.com>

+4 -1
+4 -1
fs/nfs/pnfs.c
··· 1090 1090 pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */ 1091 1091 spin_unlock(&ino->i_lock); 1092 1092 pnfs_free_lseg_list(&tmp_list); 1093 + pnfs_layoutcommit_inode(ino, true); 1093 1094 return true; 1094 1095 1095 1096 out_noroc: ··· 1105 1104 } 1106 1105 } 1107 1106 spin_unlock(&ino->i_lock); 1108 - if (layoutreturn) 1107 + if (layoutreturn) { 1108 + pnfs_layoutcommit_inode(ino, true); 1109 1109 pnfs_send_layoutreturn(lo, stateid, IOMODE_ANY, true); 1110 + } 1110 1111 return false; 1111 1112 } 1112 1113