@@ -1881,6 +1881,14 @@ ff_layout_cleanup_layoutstats(struct nfs42_layoutstat_data *data)
for (i = 0; i < data->args.num_dev; i++) {
mirror = data->args.devinfo[i].layout_private;
data->args.devinfo[i].layout_private = NULL;
+ if (data->res.rpc_status == NFS4_OK) {
+ spin_lock(&mirror->lock);
+ memset(&mirror->read_stat.io_stat, 0,
+ sizeof(mirror->read_stat.io_stat));
+ memset(&mirror->write_stat.io_stat, 0,
+ sizeof(mirror->write_stat.io_stat));
+ spin_unlock(&mirror->lock);
+ }
pnfs_put_lseg(mirror->lseg);
}
}
Per RFC NFSv42 draft, client MUST reset the statistics after getting a successfully reply from the metadata server. Signed-off-by: Peng Tao <tao.peng@primarydata.com> --- fs/nfs/flexfilelayout/flexfilelayout.c | 8 ++++++++ 1 file changed, 8 insertions(+)