summaryrefslogtreecommitdiff
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-06-27 15:45:46 (GMT)
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-06-27 15:48:58 (GMT)
commit6c5a0d891543873aefc3aaf846c1e7afe0982ff9 (patch)
tree67c0fa7f5c11a4288041a60280171f9c53d1f2ea /fs/nfs/pnfs.c
parentda2e8127510525eb4bce0fe34aff06192e042c8f (diff)
downloadlinux-6c5a0d891543873aefc3aaf846c1e7afe0982ff9.tar.xz
NFSv4.2: LAYOUTSTATS is optional to implement
Make it so, by checking the return value for NFS4ERR_MOTSUPP and caching the information as a server capability. 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 40baceb..0ba9a02 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2266,6 +2266,9 @@ pnfs_report_layoutstat(struct inode *inode)
if (!pnfs_enabled_sb(server) || !ld->prepare_layoutstats)
goto out;
+ if (!nfs_server_capable(inode, NFS_CAP_LAYOUTSTATS))
+ goto out;
+
if (test_and_set_bit(NFS_INO_LAYOUTSTATS, &nfsi->flags))
goto out;