Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4716374pxu; Thu, 10 Dec 2020 03:52:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJym1ZQQG7ZIkhQRkqxAO6ZdpPvmzFS4tOdu7LJVBGG//Fba+r87cr+p6Iik3eRsgYU6Cyx9 X-Received: by 2002:a17:906:ce23:: with SMTP id sd3mr6050506ejb.69.1607601125862; Thu, 10 Dec 2020 03:52:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607601125; cv=none; d=google.com; s=arc-20160816; b=J9IWWKw3ijZQxU9syaN5XL2dfzsGV2wJexhv/2Llznr9JSHRrQvdDdGY6hOMT5ry5X e3nzGIosCkM8RCh3Wk0mkTD60JGQ+Dyv8ekb+FSUu+XH/m/P73bJu25kTskJ+zVScSe1 i+OehSQKSgO77tRMh3fwLUOTmU2+6ZFTij8YqdzhJH5QW4EG++ypDaRM07Dch9WMV8BJ mUAG3qL2kMGcGg4HPssgHfDJPxYHHJT035RP3jAO0SZlXptM7cuMlIIrrbSWbkuPzaLP fd8Ca2OBtX+OZtoFMlu1v71MgoVFnFbkWCK4IYbKExEsMIh5TbA0Pdl7IrpkUDG0V4gr wREQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=B+jlAUAcRssnYcKi4pFhrdSjTYVxa6h13RNO3igboK0=; b=bZLF6tVuySFvoM29k9e0y5vY6Gu//MUi8TlC6a50jW+A7unyUPzF+ldqdn6Ffvcu1D CBChPAfrCey0VIZ5FoSX4/eQnlNYOYz4/+LqFe+B4DYzc/GW9mIv0xoLGx/GJCAm3Di+ C0cl1QMVAWqZPlB5zjsmrmye4iXIEvTmk0+3yp9/pV1+HW1Kjz0ILMeUshci1ann9RV0 Sc6kd+7feyU7YrI6J/D0tbxqo54VbQ35rjyMnepajyeoRgzc97miHjs/X7eJ+A/Oa6rK 8G+9gC5d7xQPHlwJFY1L2jPNVez/oypKBHWAKoQMNvuRceP4ett0o2pdIO3qKnIZWaO+ x1iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@desy.de header.s=default header.b=SiBbE53K; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g32si2693822ede.551.2020.12.10.03.51.30; Thu, 10 Dec 2020 03:52:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@desy.de header.s=default header.b=SiBbE53K; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389132AbgLJK4f (ORCPT + 99 others); Thu, 10 Dec 2020 05:56:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732652AbgLJK43 (ORCPT ); Thu, 10 Dec 2020 05:56:29 -0500 Received: from smtp-o-1.desy.de (smtp-o-1.desy.de [IPv6:2001:638:700:1038::1:9a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE2DC0613D6 for ; Thu, 10 Dec 2020 02:55:48 -0800 (PST) Received: from smtp-buf-1.desy.de (smtp-buf-1.desy.de [IPv6:2001:638:700:1038::1:a4]) by smtp-o-1.desy.de (Postfix) with ESMTP id CCCD6E0858 for ; Thu, 10 Dec 2020 11:55:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-1.desy.de CCCD6E0858 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1607597745; bh=B+jlAUAcRssnYcKi4pFhrdSjTYVxa6h13RNO3igboK0=; h=From:To:Cc:Subject:Date:From; b=SiBbE53KDF/JvuCBNGSc6JdASTeH5On9HUFaHmNsB7a/jP/UzTTvmG2KYSLrbtSJe 42INOooH9mJBtYTDkdc2kGt+ALZeZ+R8G562P1RQN07ofQgQ8c/RRyWVFMrNJmxaYm +VuJ8dEfZsEXHDm8qAk4VVsbLLXPMkPqOQa0XfSE= Received: from smtp-m-1.desy.de (smtp-m-1.desy.de [IPv6:2001:638:700:1038::1:81]) by smtp-buf-1.desy.de (Postfix) with ESMTP id C60661208A0; Thu, 10 Dec 2020 11:55:45 +0100 (CET) X-Virus-Scanned: amavisd-new at desy.de Received: from os-46-nfs-devel.desy.de (os-46-nfs-devel.desy.de [131.169.46.150]) by smtp-intra-3.desy.de (Postfix) with ESMTP id 9807880067; Thu, 10 Dec 2020 11:55:45 +0100 (CET) From: Tigran Mkrtchyan To: linux-nfs@vger.kernel.org Cc: anna.schumaker@netapp.com, trond.myklebust@hammerspace.com, Tigran Mkrtchyan Subject: [PATCH] nfs41: update ff_layout_io_track_ds_error to accept rpc task Date: Thu, 10 Dec 2020 10:55:43 +0000 Message-Id: <20201210105543.22489-1-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org When debugging READ_PLUS issues sent to DS I noticed that layoutstats was reporting READ, though READ_PLUS was used. The ff_layout_io_track_ds_error function takes the 'major' opnum as an argumentas well as the corresponding resulting error code. By passing rpc task as an argument, the bogh values can be extracted insideff_layout_io_track_ds_error and reduce a possibility of calling with incorrect opnum. Signed-off-by: Tigran Mkrtchyan --- fs/nfs/flexfilelayout/flexfilelayout.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index a163533446fa..9da11586f685 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1213,11 +1213,13 @@ static int ff_layout_async_handle_error(struct rpc_task *task, static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg, u32 idx, u64 offset, u64 length, - u32 *op_status, int opnum, int error) + u32 *op_status, struct rpc_task *task) { struct nfs4_ff_layout_mirror *mirror; u32 status = *op_status; int err; + int error = task->tk_status; + int opnum = task->tk_msg.rpc_proc->p_statidx; if (status == 0) { switch (error) { @@ -1279,8 +1281,7 @@ static int ff_layout_read_done_cb(struct rpc_task *task, if (task->tk_status < 0) { ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, hdr->args.offset, hdr->args.count, - &hdr->res.op_status, OP_READ, - task->tk_status); + &hdr->res.op_status, task); trace_ff_layout_read_error(hdr); } @@ -1446,8 +1447,7 @@ static int ff_layout_write_done_cb(struct rpc_task *task, if (task->tk_status < 0) { ff_layout_io_track_ds_error(hdr->lseg, hdr->pgio_mirror_idx, hdr->args.offset, hdr->args.count, - &hdr->res.op_status, OP_WRITE, - task->tk_status); + &hdr->res.op_status, task); trace_ff_layout_write_error(hdr); } @@ -1492,8 +1492,7 @@ static int ff_layout_commit_done_cb(struct rpc_task *task, if (task->tk_status < 0) { ff_layout_io_track_ds_error(data->lseg, data->ds_commit_index, data->args.offset, data->args.count, - &data->res.op_status, OP_COMMIT, - task->tk_status); + &data->res.op_status, task); trace_ff_layout_commit_error(data); } -- 2.27.0