From: Trond Myklebust Date: Thu, 27 Apr 2017 19:30:00 +0000 (-0400) Subject: pNFS: Ensure we check layout validity before marking it for return X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bdebfccd0ea6fc00c5ea8c832401111958bd24cf;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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);