Skip to content

Commit

Permalink
NFSv4.1/pnfs: Ensure we send layoutcommit before return-on-close
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust committed Mar 27, 2015
1 parent a0815d5 commit 7140171
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,7 @@ bool pnfs_roc(struct inode *ino)
pnfs_get_layout_hdr(lo); /* matched in pnfs_roc_release */
spin_unlock(&ino->i_lock);
pnfs_free_lseg_list(&tmp_list);
pnfs_layoutcommit_inode(ino, true);
return true;

out_noroc:
Expand All @@ -1104,8 +1105,10 @@ bool pnfs_roc(struct inode *ino)
}
}
spin_unlock(&ino->i_lock);
if (layoutreturn)
if (layoutreturn) {
pnfs_layoutcommit_inode(ino, true);
pnfs_send_layoutreturn(lo, stateid, IOMODE_ANY, true);
}
return false;
}

Expand Down

0 comments on commit 7140171

Please sign in to comment.