skip LAYOUTRETURN if layout is invalid
authorOlga Kornievskaia <olga.kornievskaia@gmail.com>
Mon, 11 Jun 2018 19:32:06 +0000 (15:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:22 +0000 (07:50 +0200)
commit44a78f7d175792dbd376cbe77ce1abc3f82e5400
tree7521704a979857f353e1a20146de5462d7c8f236
parent0a84c912f575c083e2cdc123bcae93e0847f9e63
skip LAYOUTRETURN if layout is invalid

[ Upstream commit 93b7f7ad2018d2037559b1d0892417864c78b371 ]

Currently, when IO to DS fails, client returns the layout and
retries against the MDS. However, then on umounting (inode eviction)
it returns the layout again.

This is because pnfs_return_layout() was changed in
commit d78471d32bb6 ("pnfs/blocklayout: set PNFS_LAYOUTRETURN_ON_ERROR")
to always set NFS_LAYOUT_RETURN_REQUESTED so even if we returned
the layout, it will be returned again. Instead, let's also check
if we have already marked the layout invalid.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pnfs.c