OSDN Git Service

NFSv4.2: LAYOUTSTATS is optional to implement
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / nfs / pnfs.c
index 40baceb..0ba9a02 100644 (file)
@@ -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;