From: Trond Myklebust Date: Mon, 31 Aug 2015 08:25:11 +0000 (-0700) Subject: NFSv4.1/pnfs: Don't ask for a read layout for an empty file. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4ae93560b11cb2b57ea5732d442458694ab0c168;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git NFSv4.1/pnfs: Don't ask for a read layout for an empty file. Signed-off-by: Trond Myklebust --- 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;