summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-08-31 10:25:11 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-08-31 10:33:12 +0200
commit4ae93560b11cb2b57ea5732d442458694ab0c168 (patch)
tree7560bbc0d3f4b9091ee0dcde21889abc4ba105fb /fs/nfs/pnfs.c
parentNFSv4.1: Fix a protocol issue with CLOSE stateids (diff)
downloadlinux-4ae93560b11cb2b57ea5732d442458694ab0c168.tar.xz
linux-4ae93560b11cb2b57ea5732d442458694ab0c168.zip
NFSv4.1/pnfs: Don't ask for a read layout for an empty file.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 4eec540de9ea..c4f918eca3d2 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1494,6 +1494,9 @@ pnfs_update_layout(struct inode *ino,
if (!pnfs_enabled_sb(NFS_SERVER(ino)))
goto out;
+ if (iomode == IOMODE_READ && i_size_read(ino) == 0)
+ goto out;
+
if (pnfs_within_mdsthreshold(ctx, ino, iomode))
goto out;