pNFS: Fix a deadlock between read resends and layoutreturn
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 27 Nov 2016 20:12:39 +0000 (15:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Jan 2017 07:22:02 +0000 (08:22 +0100)
commitc513ade4ca564a17814bcaffff981489be2afcf4
tree3cdfdbba0e96221a73d938db2d31cd2a6f474b89
parentabb2903f1ac21ba17698728d17c442deb3266ab8
pNFS: Fix a deadlock between read resends and layoutreturn

commit 54e4a0dfa25d9365c4e80a639e80d9213eb6edbe upstream.

We must not call nfs_pageio_init_read() on a new nfs_pageio_descriptor
while holding a reference to a layout segment, as that can deadlock
pnfs_update_layout().

Fixes: d67ae825a59d6 ("pnfs/flexfiles: Add the FlexFile Layout Driver")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/flexfilelayout/flexfilelayout.c
fs/nfs/pnfs.c