summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-04-27 15:30:00 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2017-04-28 13:07:01 -0400
commitbdebfccd0ea6fc00c5ea8c832401111958bd24cf (patch)
tree2aae88de7f66c62291edb2a18f22bf96f88d4326 /fs/nfs
parent88bd4f862943205183c2fc20bbba103c71e9990b (diff)
downloadlinux-stable-bdebfccd0ea6fc00c5ea8c832401111958bd24cf.tar.gz
linux-stable-bdebfccd0ea6fc00c5ea8c832401111958bd24cf.tar.bz2
linux-stable-bdebfccd0ea6fc00c5ea8c832401111958bd24cf.zip
pNFS: Ensure we check layout validity before marking it for return
pnfs_error_mark_layout_for_return needs to check that the layout is valid before calling pnfs_set_plh_return_info(). Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/pnfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index eff266ea813c..e45b3ffeda08 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2049,6 +2049,10 @@ void pnfs_error_mark_layout_for_return(struct inode *inode,
bool return_now = false;
spin_lock(&inode->i_lock);
+ if (!pnfs_layout_is_valid(lo)) {
+ spin_unlock(&inode->i_lock);
+ return;
+ }
pnfs_set_plh_return_info(lo, range.iomode, 0);
/* Block LAYOUTGET */
set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags);