diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-01-04 11:28:11 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-01-04 12:36:12 -0500 |
commit | 4b0934baf9317e05c7568da1366a1d65f151d81f (patch) | |
tree | 471df710b857f344eb684e401de1a6e77697fd98 | |
parent | 10335556c9e6ed2e1949fb595b7775f475299832 (diff) |
NFSv4.1/pNFS: Fix a race in initiate_file_draining()
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>
-rw-r--r-- | fs/nfs/callback_proc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 2be8b252e3b1..f0939d097406 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -216,11 +216,8 @@ static u32 initiate_file_draining(struct nfs_client *clp, | |||
216 | goto unlock; | 216 | goto unlock; |
217 | } | 217 | } |
218 | 218 | ||
219 | if (pnfs_mark_matching_lsegs_invalid(lo, &free_me_list, | 219 | if (pnfs_mark_matching_lsegs_return(lo, &free_me_list, |
220 | &args->cbl_range)) { | 220 | &args->cbl_range)) { |
221 | pnfs_mark_matching_lsegs_return(lo, | ||
222 | &free_me_list, | ||
223 | &args->cbl_range); | ||
224 | rv = NFS4_OK; | 221 | rv = NFS4_OK; |
225 | goto unlock; | 222 | goto unlock; |
226 | } | 223 | } |