pNFS: Skip checking for return-on-close if the layout is invalid

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
Trond Myklebust 2016-11-21 11:05:33 -05:00
parent e685d237e6
commit 0cdc329ec9
1 changed files with 2 additions and 1 deletions

View File

@ -1190,7 +1190,8 @@ bool pnfs_roc(struct inode *ino)
spin_lock(&ino->i_lock);
lo = nfsi->layout;
if (!lo || test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags))
if (!lo || !pnfs_layout_is_valid(lo) ||
test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags))
goto out_noroc;
/* no roc if we hold a delegation */