Skip to content

Commit

Permalink
pNFS/flexfiles: Handle expired layout segments in ff_layout_initiate_…
Browse files Browse the repository at this point in the history
…commit()

If the layout has expired due to a fencing event, then we should not
attempt to commit to the DS.

Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
  • Loading branch information
trondmypd authored and amschuma-ntap committed Jul 19, 2017
1 parent 4118188 commit 4b75053
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/nfs/flexfilelayout/flexfilelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,10 @@ static int ff_layout_initiate_commit(struct nfs_commit_data *data, int how)
int vers, ret;
struct nfs_fh *fh;

if (!lseg || !(pnfs_is_valid_lseg(lseg) ||
test_bit(NFS_LSEG_LAYOUTRETURN, &lseg->pls_flags)))
goto out_err;

idx = calc_ds_index_from_commit(lseg, data->ds_commit_index);
ds = nfs4_ff_layout_prepare_ds(lseg, idx, true);
if (!ds)
Expand Down

0 comments on commit 4b75053

Please sign in to comment.