提交 ea0ded74 编写于 作者: F Fred Isaman 提交者: Trond Myklebust

nfs4.1: prevent race that allowed use of freed layout in _pnfs_return_layout

mark_matching_lsegs_invalid could put the last ref to the layout, so
the get_layout_hdr needs to be called first.
Signed-off-by: NFred Isaman <iisaman@netapp.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 1ed3a853
......@@ -640,10 +640,10 @@ _pnfs_return_layout(struct inode *ino)
return status;
}
stateid = nfsi->layout->plh_stateid;
mark_matching_lsegs_invalid(lo, &tmp_list, NULL);
lo->plh_block_lgets++;
/* Reference matched in nfs4_layoutreturn_release */
get_layout_hdr(lo);
mark_matching_lsegs_invalid(lo, &tmp_list, NULL);
lo->plh_block_lgets++;
spin_unlock(&ino->i_lock);
pnfs_free_lseg_list(&tmp_list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册