NFSv4.2: LAYOUTSTATS is optional to implement
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 27 Jun 2015 15:45:46 +0000 (11:45 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 27 Jun 2015 15:48:58 +0000 (11:48 -0400)
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>
fs/nfs/nfs42proc.c
fs/nfs/nfs4proc.c
fs/nfs/pnfs.c
include/linux/nfs_fs_sb.h

index 06c74cd..f486b80 100644 (file)
@@ -189,9 +189,15 @@ nfs42_layoutstat_done(struct rpc_task *task, void *calldata)
        if (!nfs4_sequence_done(task, &data->res.seq_res))
                return;
 
-       /* well, we don't care about errors at all! */
-       if (task->tk_status)
+       switch (task->tk_status) {
+       case 0:
+               break;
+       case -ENOTSUPP:
+       case -EOPNOTSUPP:
+               NFS_SERVER(data->inode)->caps &= ~NFS_CAP_LAYOUTSTATS;
+       default:
                dprintk("%s server returns %d\n", __func__, task->tk_status);
+       }
 }
 
 static void
Simple merge
diff --cc fs/nfs/pnfs.c
Simple merge
Simple merge