From patchwork Tue Jun 16 14:47:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Tao X-Patchwork-Id: 6618851 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD220C0020 for ; Tue, 16 Jun 2015 14:49:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 05F5D207DF for ; Tue, 16 Jun 2015 14:49:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2619E207DC for ; Tue, 16 Jun 2015 14:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756628AbbFPOtR (ORCPT ); Tue, 16 Jun 2015 10:49:17 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:33538 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756554AbbFPOtQ (ORCPT ); Tue, 16 Jun 2015 10:49:16 -0400 Received: by pdjn11 with SMTP id n11so16063792pdj.0 for ; Tue, 16 Jun 2015 07:49:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MgWvs560iZbWen6CVUK7JsHFYQ+xUb2sqLMKXPBJYTU=; b=cDs22ln+XHrMVBMfWZPYL31P8wEhT081lvhl9rAwbnuQa72BMlyPSLnaItjKVhckH0 AzEU9Qgci5JqfViMDjZwchoNaRzczPEpzDZP3LLqJawFH1a4CX733BboOczDfLd5ekTM QrtbvYrfvwbZw0FbkUZ2X8jB4H47sU0YQZSqEZE4bqGaxTVMAGA8Q4G2HDa6I/5RBfir dlhOi5II3RsnLEX59w7z1Cg8yyAZdkEX5zdRgYTgu6vkgI1xGRZiHSfTRRNzTwm3j7Ak DcSNDqompbDewZkqZFR8++bqa9VeWHwzm03O+KYZQFI6DJ3Yk0JWYORYYdVVyauHIzDD qHhA== X-Gm-Message-State: ALoCoQm5fikwbjDFJUcM+6li/6HuL7T36KELllrRduc1HH8GHj16FjL2E0NZsYeHWTgO/aKF9H7E X-Received: by 10.68.201.168 with SMTP id kb8mr1391556pbc.50.1434466155865; Tue, 16 Jun 2015 07:49:15 -0700 (PDT) Received: from lear.localdomain (ec2-54-65-164-9.ap-northeast-1.compute.amazonaws.com. [54.65.164.9]) by mx.google.com with ESMTPSA id wa4sm1698677pab.17.2015.06.16.07.49.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2015 07:49:15 -0700 (PDT) From: Peng Tao To: linux-nfs Cc: Peng Tao Subject: [PATCH 09/11] pnfs/flexfiles: reset IO statistics upon LAYOUTSTATS success Date: Tue, 16 Jun 2015 22:47:30 +0800 Message-Id: <1434466052-10491-10-git-send-email-tao.peng@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1434466052-10491-1-git-send-email-tao.peng@primarydata.com> References: <1434466052-10491-1-git-send-email-tao.peng@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Per RFC NFSv42 draft, client MUST reset the statistics after getting a successfully reply from the metadata server. Signed-off-by: Peng Tao --- fs/nfs/flexfilelayout/flexfilelayout.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 64beedd..4b79c74 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -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); } }