Skip to content

Commit

Permalink
NFSv4.1/pNFS: Fix a race in initiate_file_draining()
Browse files Browse the repository at this point in the history
Peng Tao points out that the call to pnfs_mark_matching_lsegs_return()
could race with pnfs_put_lseg(), in which case the layout segment is
cleared, but no layoutreturn will be sent.
Fix is to replace the call to pnfs_mark_matching_lsegs_invalid().

Reported-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Trond Myklebust committed Jan 4, 2016
1 parent 1033555 commit 4b0934b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/nfs/callback_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,8 @@ static u32 initiate_file_draining(struct nfs_client *clp,
goto unlock;
}

if (pnfs_mark_matching_lsegs_invalid(lo, &free_me_list,
if (pnfs_mark_matching_lsegs_return(lo, &free_me_list,
&args->cbl_range)) {
pnfs_mark_matching_lsegs_return(lo,
&free_me_list,
&args->cbl_range);
rv = NFS4_OK;
goto unlock;
}
Expand Down

0 comments on commit 4b0934b

Please sign in to comment.