summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-05-01 17:06:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-24 11:00:21 +0100
commit1b9c9549b2c9814d35b22fa817466226d9fbb8e5 (patch)
tree05378e180b27949a8939eb89adf5423ee66718b0 /drivers
parente22a6754abda4ab563fce3f3241e71a8c917c979 (diff)
pNFS: Fix a deadlock when coalescing writes and returning the layout
[ Upstream commit 61f454e30c18a28924e96be12592c0d5e24bcc81 ] Consider the following deadlock: Process P1 Process P2 Process P3 ========== ========== ========== lock_page(page) lseg = pnfs_update_layout(inode) lo = NFS_I(inode)->layout pnfs_error_mark_layout_for_return(lo) lock_page(page) lseg = pnfs_update_layout(inode) In this scenario, - P1 has declared the layout to be in error, but P2 holds a reference to a layout segment on that inode, so the layoutreturn is deferred. - P2 is waiting for a page lock held by P3. - P3 is asking for a new layout segment, but is blocked waiting for the layoutreturn. The fix is to ensure that pnfs_error_mark_layout_for_return() does not set the NFS_LAYOUT_RETURN flag, which blocks P3. Instead, we allow the latter to call LAYOUTGET so that it can make progress and unblock P2. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions