]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4.x/pnfs: Fix a race between layoutget and pnfs_destroy_layout
authorTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 22 Feb 2016 22:34:59 +0000 (17:34 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 22 Feb 2016 22:34:59 +0000 (17:34 -0500)
commit17558b3f5643e88219a3c49031994661d1981be3
treee6ffc2bd5a1bc51a60bd22c5d7d59aa0f72d9935
parente3037b9fdae25f69922493283e70ad7069ae78e3
NFSv4.x/pnfs: Fix a race between layoutget and pnfs_destroy_layout

If the server reboots while there is a layoutget outstanding, then
the call to pnfs_choose_layoutget_stateid() will fail with an EAGAIN
error, which causes an infinite loop in send_layoutget(). The reason
why we never break out of the loop is that the layout 'plh_block_lgets'
field is never cleared.

Fix is to replace plh_block_lgets with NFS_LAYOUT_INVALID_STID, which
can be reset after a new layoutget.

Fixes: 9ee0bfae3fa0c ("pNFS: Ensure nfs4_layoutget_prepare returns...")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/pnfs.c