From patchwork Mon Aug 19 19:28:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 11101723 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4F0B1399 for ; Mon, 19 Aug 2019 19:29:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B580922CEC for ; Mon, 19 Aug 2019 19:29:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Btr9ix3b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728429AbfHST3E (ORCPT ); Mon, 19 Aug 2019 15:29:04 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:33994 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbfHST3E (ORCPT ); Mon, 19 Aug 2019 15:29:04 -0400 Received: by mail-io1-f67.google.com with SMTP id s21so6869876ioa.1 for ; Mon, 19 Aug 2019 12:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+O0L4th40lZfUVO9h1Mje9KCwXPgIa9fuj6EJ2cZs+8=; b=Btr9ix3b1xztCHj5X+hQqlPVKYBNLR7kIWvCamMJ2uxR4+lkH0AXXu98et2mtYHvIA /oO2D4S0DEFK/nCzPEPxKd9V5q70BBlei+heYvhtanNCCDTZnXYxIUil7uGK5Y/OOK5M FBBd9Zer/8XX/AqRlQHi61MbQmAlYTT7VNm2dr4DjEINs/UWblbIQTeVnQjiEHOL936t +PzJ+KU6+f6dCZ8hVsVs4NteBoRg+V9oS+PH7SF8wKZ0+UvFHM6T7ktrACLBXaU58mk2 kjh+yq9WXAwGV5A7aIB5T6rPBhG5oEMt9hYHI79u8BLg39H5SJr2QEUfm55/qSIlCO22 DDAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+O0L4th40lZfUVO9h1Mje9KCwXPgIa9fuj6EJ2cZs+8=; b=Eu7o8AtmtI8NX7Nh4r2furGvl4h+KgiQEhVA07kOdTqHlVLlyv5Qlc/Y1Nvg982dHC btd/qEQMkqs76TqpbQoofQ81II3R3K//JpbMxHkW9pYiI+IM1TlZCw0I6IsBEGPiYoPm hY5zwG3LMnCfQifQ88KwjPNKxg9yLhn/maLDzZDICPqSG+YC1e3scBs2vMzFunOSKcQE LF0jr83ty82AwIKPRaRcuc0cvBdkqV5hb7me38trFIVE3UnY0IOPl6LGAKNBYlzK7Y0M 9/51YTiFFtFKz4iotERW/vegRfAub5mKs16FRZ0wK0lF56Nd3Toi5dfuUGC+/CmqJ6CU t4+w== X-Gm-Message-State: APjAAAUjNxyA7zqxgLdSDWOwCqWIIlwT4MIl4e9QGonqu1UYhvGtSJeJ aNITEUpGVSlIcc/TJ6jub7WljpPl+P8= X-Google-Smtp-Source: APXvYqzQ8q4fdtpKbWLhRKXUZFclqlaRCZ+6LoPT2/B4Mb1/mcYaTz6K3fb1owFQO90jhZnI7XB+Og== X-Received: by 2002:a5e:de0d:: with SMTP id e13mr15023269iok.144.1566242943225; Mon, 19 Aug 2019 12:29:03 -0700 (PDT) Received: from gouda.nowheycreamery.com (d28-23-121-75.dim.wideopenwest.com. [23.28.75.121]) by smtp.gmail.com with ESMTPSA id v23sm16243957ioh.58.2019.08.19.12.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 12:29:02 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH 1/6] NFS: Add an nfs4_call_sync_custom() function Date: Mon, 19 Aug 2019 15:28:55 -0400 Message-Id: <20190819192900.19312-2-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> References: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker There are a few cases where we need to manually configure the rpc_task_setup structure to get the behavior we want. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1406858bae6c..e5b6499c0b8b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1073,14 +1073,26 @@ static const struct rpc_call_ops nfs40_call_sync_ops = { .rpc_call_done = nfs40_call_sync_done, }; +static int nfs4_call_sync_custom(struct rpc_task_setup *task_setup) +{ + int ret; + struct rpc_task *task; + + task = rpc_run_task(task_setup); + if (IS_ERR(task)) + return PTR_ERR(task); + + ret = task->tk_status; + rpc_put_task(task); + return ret; +} + static int nfs4_call_sync_sequence(struct rpc_clnt *clnt, struct nfs_server *server, struct rpc_message *msg, struct nfs4_sequence_args *args, struct nfs4_sequence_res *res) { - int ret; - struct rpc_task *task; struct nfs_client *clp = server->nfs_client; struct nfs4_call_sync_data data = { .seq_server = server, @@ -1094,14 +1106,7 @@ static int nfs4_call_sync_sequence(struct rpc_clnt *clnt, .callback_data = &data }; - task = rpc_run_task(&task_setup); - if (IS_ERR(task)) - ret = PTR_ERR(task); - else { - ret = task->tk_status; - rpc_put_task(task); - } - return ret; + return nfs4_call_sync_custom(&task_setup); } int nfs4_call_sync(struct rpc_clnt *clnt, From patchwork Mon Aug 19 19:28:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 11101725 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 353A514DB for ; Mon, 19 Aug 2019 19:29:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 145D1206C1 for ; Mon, 19 Aug 2019 19:29:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VJPQy38R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728447AbfHST3F (ORCPT ); Mon, 19 Aug 2019 15:29:05 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:33996 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbfHST3F (ORCPT ); Mon, 19 Aug 2019 15:29:05 -0400 Received: by mail-io1-f66.google.com with SMTP id s21so6869978ioa.1 for ; Mon, 19 Aug 2019 12:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=23wLHJSmn/ZxNKzqVt7PQBC+yvBjUAUPtEmuEjnDvDQ=; b=VJPQy38RQnAW/fXuBxHxMgp7i1Jc4K9BNYwFwTr3JZiIwwJyRAevzRwlhvHThdBQat nZ0fY9qALusCfn3GsRKiaYgR+5wtn3cGVmmxslDRSaqPSe7O8P2Yd88R4ULm9DJyhmEQ z7+nckN2YEO75fBn+43n9UxV5k8DeG9lf/oblrWh/AsAxpBjBBQRtvGZuyTV3EjAOe/F +HsjEnzWAUDa4FBe/Va6DTDjN4g22wR/IyAiST6nsQNBN+Rqm61opv/OIPsR4Jxys4kz zd0qulp1O8Ee7Zj7/fcIvhfdJLPeqDsI88LSwtk+ajQp1QPnZDXGNNYz7eFtV+do63hT skgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=23wLHJSmn/ZxNKzqVt7PQBC+yvBjUAUPtEmuEjnDvDQ=; b=D/wMSiR3MzLxjqF+sUOPxuFh/mgSQf7INAmYpU6NLoxDnhh1MPvxyAtWR0dZJyRiBS EeiI5I95iB3baErQP3TO9XcmHa5LiV5xWk8vR+74LaLqah/CcsmdFebbVnvwLrmqgTHX 5PKDGHh4OpglNJDQcylxCmduGn7P2F3FcKiasFwVn0qVt5GFSkRoEKIKaccpebZePfac bZb+8+3depaltEn8DaUSu9NJP1tiCPLAITpgxUu2FQbBEf0YYyp/qU4gkc5dGsQwMfd9 uL1A0aIJ4esO1YsKlAHq2p4x9JvuDaJr6kZsk/JgiZ4ZAS5Tbqa19LgPrAbfKH/R/GDq Hkdw== X-Gm-Message-State: APjAAAWsk48GmBsWRCyNsgow14jt55L3/wPPqFgCLzlcexdj7WOc3gR0 abrDeROHrPdl+UGwMarg+lU= X-Google-Smtp-Source: APXvYqxK0FdC6KvIzew0S1iVnVH4Fbe8MiT2mjd4kdc8+GAadOjN0RQq35k5PSiXBpCH826FXqcvxA== X-Received: by 2002:a6b:f910:: with SMTP id j16mr8093272iog.135.1566242944212; Mon, 19 Aug 2019 12:29:04 -0700 (PDT) Received: from gouda.nowheycreamery.com (d28-23-121-75.dim.wideopenwest.com. [23.28.75.121]) by smtp.gmail.com with ESMTPSA id v23sm16243957ioh.58.2019.08.19.12.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 12:29:03 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH 2/6] NFS: Have nfs4_proc_setclientid() call nfs4_call_sync_custom() Date: Mon, 19 Aug 2019 15:28:56 -0400 Message-Id: <20190819192900.19312-3-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> References: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker Rather than running the task manually Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e5b6499c0b8b..234312240f33 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6023,7 +6023,6 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, .rpc_resp = res, .rpc_cred = cred, }; - struct rpc_task *task; struct rpc_task_setup task_setup_data = { .rpc_client = clp->cl_rpcclient, .rpc_message = &msg, @@ -6056,17 +6055,12 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, dprintk("NFS call setclientid auth=%s, '%s'\n", clp->cl_rpcclient->cl_auth->au_ops->au_name, clp->cl_owner_id); - task = rpc_run_task(&task_setup_data); - if (IS_ERR(task)) { - status = PTR_ERR(task); - goto out; - } - status = task->tk_status; + + status = nfs4_call_sync_custom(&task_setup_data); if (setclientid.sc_cred) { clp->cl_acceptor = rpcauth_stringify_acceptor(setclientid.sc_cred); put_rpccred(setclientid.sc_cred); } - rpc_put_task(task); out: trace_nfs4_setclientid(clp, status); dprintk("NFS reply setclientid: %d\n", status); From patchwork Mon Aug 19 19:28:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 11101727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6DEC14F7 for ; Mon, 19 Aug 2019 19:29:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A715A22CEC for ; Mon, 19 Aug 2019 19:29:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VBJ8rdET" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728398AbfHST3G (ORCPT ); Mon, 19 Aug 2019 15:29:06 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:39850 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728438AbfHST3F (ORCPT ); Mon, 19 Aug 2019 15:29:05 -0400 Received: by mail-io1-f67.google.com with SMTP id l7so6114266ioj.6 for ; Mon, 19 Aug 2019 12:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=94yXIfd25kA/1yPLVBoYzLZWboZ8NrD7pkHXxbAJPw0=; b=VBJ8rdETgIbSmEy6jgbdhSHXcErgY2AVmWuN3+hWqOn5Or0NwXJpcmX01/YvpG156P 0zkvCB2ogkADNwu1QbBKRHf1NA1ayYZrfZrsdYLyHQvJnHi9U8GmhKMjzJAzWhUnSb1P Z6aiwudYJ+lLDGjmKFPvhNfP1nWQ56eLz2z2Wu7qJLdoCAVPPHPf7oOKoTbU75vMN+zn jJn3JpSWA8/IA3IdMHg+65rGREb6wluIJ1Wai7ipouFrbtazeqBnNdX1MPVALBAd82dJ CMNEfvekQaO2d9fIEVKZOTCfHW7DOwbrTq+/7buWuNHAUSNFyLfXA1nHK2tcnsMvmLm8 5gcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=94yXIfd25kA/1yPLVBoYzLZWboZ8NrD7pkHXxbAJPw0=; b=qNn1jTVRLNghtrVojj5dujMP3rYHv0UbUxJbbo8Q6X7ToEOs5SAruCuyUlNp0rfj3l 3jR4p2l7HQKNuoDDc6nub5PMceDzbBaCNeUx3yggusNtacdM0dApkjxy4NGdpP5c7oYq U3cGP6xCfKsZXGTXyOqxA4TcSog5MovZbfD9uH+/seGXiGcGoDNUPLtwSK7ivcb2ZL/A DK5q5B9vLqwanI5ZvZw/h61HGmyG7Pw38N5c+Fl4rMZtlCfAk6NC3gIGhSxZp418sldh ZYkJfyXr/eDQlliwCIiyuFsnPtKgU5GrGTw6bN5c2s1TI53QYojeFBUVsAikTfmU9McS Zoiw== X-Gm-Message-State: APjAAAVm5eXHjjIL7znetfyt7wJ6zE06GIwtQ9V/2wZigmZLttV6dtw3 tbqT6VKnH3uBnNifcJ689qh4S+jwRbw= X-Google-Smtp-Source: APXvYqzd8VIdIsjOEzbD95Fj4a0usI2Uvxstru56ULiZ28BzNEnPExS8uV4Lpi1GC71gZXErR297gg== X-Received: by 2002:a5d:9c12:: with SMTP id 18mr27842762ioe.48.1566242945006; Mon, 19 Aug 2019 12:29:05 -0700 (PDT) Received: from gouda.nowheycreamery.com (d28-23-121-75.dim.wideopenwest.com. [23.28.75.121]) by smtp.gmail.com with ESMTPSA id v23sm16243957ioh.58.2019.08.19.12.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 12:29:04 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH 3/6] NFS: Have _nfs4_proc_secinfo() call nfs4_call_sync_custom() Date: Mon, 19 Aug 2019 15:28:57 -0400 Message-Id: <20190819192900.19312-4-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> References: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker We do this to set the RPC_TASK_NO_ROUND_ROBIN flag in the task_setup structure Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 234312240f33..de2b3fd806ef 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7644,6 +7644,8 @@ int nfs4_proc_fsid_present(struct inode *inode, const struct cred *cred) static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors, bool use_integrity) { int status; + struct rpc_clnt *clnt = NFS_SERVER(dir)->client; + struct nfs_client *clp = NFS_SERVER(dir)->nfs_client; struct nfs4_secinfo_arg args = { .dir_fh = NFS_FH(dir), .name = name, @@ -7656,26 +7658,37 @@ static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct .rpc_argp = &args, .rpc_resp = &res, }; - struct rpc_clnt *clnt = NFS_SERVER(dir)->client; + struct nfs4_call_sync_data data = { + .seq_server = NFS_SERVER(dir), + .seq_args = &args.seq_args, + .seq_res = &res.seq_res, + }; + struct rpc_task_setup task_setup = { + .rpc_client = clnt, + .rpc_message = &msg, + .callback_ops = clp->cl_mvops->call_sync_ops, + .callback_data = &data, + .flags = RPC_TASK_NO_ROUND_ROBIN, + }; const struct cred *cred = NULL; if (use_integrity) { - clnt = NFS_SERVER(dir)->nfs_client->cl_rpcclient; - cred = nfs4_get_clid_cred(NFS_SERVER(dir)->nfs_client); + clnt = clp->cl_rpcclient; + task_setup.rpc_client = clnt; + + cred = nfs4_get_clid_cred(clp); msg.rpc_cred = cred; } dprintk("NFS call secinfo %s\n", name->name); - nfs4_state_protect(NFS_SERVER(dir)->nfs_client, - NFS_SP4_MACH_CRED_SECINFO, &clnt, &msg); + nfs4_state_protect(clp, NFS_SP4_MACH_CRED_SECINFO, &clnt, &msg); + nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0); + status = nfs4_call_sync_custom(&task_setup); - status = nfs4_call_sync(clnt, NFS_SERVER(dir), &msg, &args.seq_args, - &res.seq_res, RPC_TASK_NO_ROUND_ROBIN); dprintk("NFS reply secinfo: %d\n", status); put_cred(cred); - return status; } From patchwork Mon Aug 19 19:28:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 11101729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 942901399 for ; Mon, 19 Aug 2019 19:29:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 733A422CEC for ; Mon, 19 Aug 2019 19:29:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WSbl9cN0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728438AbfHST3G (ORCPT ); Mon, 19 Aug 2019 15:29:06 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:37280 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbfHST3G (ORCPT ); Mon, 19 Aug 2019 15:29:06 -0400 Received: by mail-io1-f66.google.com with SMTP id q22so6852799iog.4 for ; Mon, 19 Aug 2019 12:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4EkaWZAwVF5PrNhAcdD0GA1eb9taUgFuiwCCExhi/vg=; b=WSbl9cN0DLPaAnCRn0sRrxP+8jOD08LExFQxl02NNjcNbGwqvCfU9miybeUBUaYiN1 Fg0c+fH7DNmcV3YY2Sq/7pid3OlMiKDzDcF8UPHWo2deuKrQKN2JJ5hZyciFu/lcOKmE 9Oxxblnx5cAkszYgc4smV+PGvSC8HYaHp3Twe+wvyD+3vFzsTn4qAX2XMzbSl54ci3Cs wev5i1HHL7TpSqIbDm0Oiqw8D7Jcg4XNB1GAXNplWIEoI6lXowP8Fri8HQY2Cki+2ppQ tVto1HtrZv3LlIrpJDe1CQ61HmYhwkcey8ONn0aTv6FTE2Wco9rU41gW26he+JMeRXK5 pYIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4EkaWZAwVF5PrNhAcdD0GA1eb9taUgFuiwCCExhi/vg=; b=I7do0W2tPHfRj8YbB9R6QA2vqrpaxptYxgExf7RXiIhp56eLQ9nJ6P/aO3mQSaU7pB UoWuRc/STY+VOZ1ViYP+0iQW1rZAPvFHisxFySlY6ab8Uodbn+m5O2z3OmV8JGgdapRJ B3WiNd1Bb7wZ4xzu2JXu70J5oCZk8RG44LHoyJwqOVodNVIO8InJohrxdU/a8HOmoYlf OB1HsT1XfNMsZlHXpyikU0vZMGW486lce6460/jirydqeYDn50unDMHZuXG85SNrHTMV S1gHijgoxnEBNLeMlVd2Keiq06SibricMAZSSgdJENDpYihnGqapLXLYmAlhKQ877DAl aWVw== X-Gm-Message-State: APjAAAVjgl8qvpcF9WDgJUQw8z7Ez71L/FHriE5HZSsPPUAAYHPbh0Cy O4yRhEHzPFQQl3vhCPusUKaak1nlxAc= X-Google-Smtp-Source: APXvYqwBGKS0W++PC3tS7k28+l1frGBafgy1yxZHy9EAc2ttbuiCbVBdEh/286vd3uvciMY+XQ0Hiw== X-Received: by 2002:a05:6602:2193:: with SMTP id b19mr7070170iob.113.1566242945806; Mon, 19 Aug 2019 12:29:05 -0700 (PDT) Received: from gouda.nowheycreamery.com (d28-23-121-75.dim.wideopenwest.com. [23.28.75.121]) by smtp.gmail.com with ESMTPSA id v23sm16243957ioh.58.2019.08.19.12.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 12:29:05 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH 4/6] NFS: Have nfs41_proc_reclaim_complete() call nfs4_call_sync_custom() Date: Mon, 19 Aug 2019 15:28:58 -0400 Message-Id: <20190819192900.19312-5-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> References: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker An async call followed by an rpc_wait_for_completion() is basically the same as a synchronous call, so we can use nfs4_call_sync_custom() to keep our custom callback ops and the RPC_TASK_NO_ROUND_ROBIN flag. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index de2b3fd806ef..1b7863ec12d3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -8857,7 +8857,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp, const struct cred *cred) { struct nfs4_reclaim_complete_data *calldata; - struct rpc_task *task; struct rpc_message msg = { .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RECLAIM_COMPLETE], .rpc_cred = cred, @@ -8866,7 +8865,7 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp, .rpc_client = clp->cl_rpcclient, .rpc_message = &msg, .callback_ops = &nfs4_reclaim_complete_call_ops, - .flags = RPC_TASK_ASYNC | RPC_TASK_NO_ROUND_ROBIN, + .flags = RPC_TASK_NO_ROUND_ROBIN, }; int status = -ENOMEM; @@ -8881,15 +8880,7 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp, msg.rpc_argp = &calldata->arg; msg.rpc_resp = &calldata->res; task_setup_data.callback_data = calldata; - task = rpc_run_task(&task_setup_data); - if (IS_ERR(task)) { - status = PTR_ERR(task); - goto out; - } - status = rpc_wait_for_completion_task(task); - if (status == 0) - status = task->tk_status; - rpc_put_task(task); + status = nfs4_call_sync_custom(&task_setup_data); out: dprintk("<-- %s status=%d\n", __func__, status); return status; From patchwork Mon Aug 19 19:28:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 11101731 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB5291399 for ; Mon, 19 Aug 2019 19:29:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C7A322CEC for ; Mon, 19 Aug 2019 19:29:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qBVg/pTE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728458AbfHST3H (ORCPT ); Mon, 19 Aug 2019 15:29:07 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:40409 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbfHST3H (ORCPT ); Mon, 19 Aug 2019 15:29:07 -0400 Received: by mail-io1-f66.google.com with SMTP id t6so6844024ios.7 for ; Mon, 19 Aug 2019 12:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FTeskTxSL+DtGp0TXc7KVfC4/gZtxXq4wbGQc6DfmlI=; b=qBVg/pTEPso7o7LkHBouWY01sElYyq/GZynstc5n7WnEeLUTBePpiXOMrUvWbBZMTt hUfl7jci90IpL79DJmiE6Y/S5lp+sBx1WZoj5CrZW+37WRG9xp2YltfRobnfrLsspek8 H73Nvy5R8GUiRx80SFxvHtO8nfexItbGIX85rpFgj/K7S+s81DMLoXQZWevgdeDNKjfv Pk2aao/MVV1zxaA6E3nk2faublDo2fo+jhyNCq1IdN+EK73cR+bGutSvkrj3cqQKUbc2 3qN4F/I1YbNIq8eVru9wq3aKZZts/eEjC2yD5ErRklat82/nxfli4w77FZqO0pRUTiMu b6RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=FTeskTxSL+DtGp0TXc7KVfC4/gZtxXq4wbGQc6DfmlI=; b=lWdAzVBH+U0uVKM0YiFNcV5UHgG8EOyDokgc7hgvz/qCMsNxsEE+9JOvShfFQWUJvT 8ADpYTcKmwxLZ5tlgtfpjC4nUlRZxCi0jf6sK0WXhAn5waz5ujdpfbYP2n92jpcXyjCz IcnKQxRCFrwGvlbIrXj6M8k8QCJEUL/VVSDqrS6eS8Fl7MnsTwe3PejWArAPTdm6pJ5N CavCbfza3b6o8Et1YUIkWpo5Wl7izalvkCerNw9oL0xg6Qx/F04E9xF51GRcfyvrgng5 g3Y6OIjEu6yFpxWaIOZO7SbgTJTHCHkbHC+wk3LYN3WRKB65IPxzVvjpLf7dpLglVuSG UxyA== X-Gm-Message-State: APjAAAWt+GIGCzb4jwTFkPODbxuZK9Cz4kLBwHaBjCqQOC7Vfut3Jcfb 71pVHjpVoMTKJIFbKU0O5S0= X-Google-Smtp-Source: APXvYqwit5her6GcaK3H9PGAQSHIFfV6c6lIy6LdNz3A6kcJkpTS/MlKYb+jf4z31PW+p5xNzFTWpw== X-Received: by 2002:a6b:7217:: with SMTP id n23mr15717401ioc.194.1566242946712; Mon, 19 Aug 2019 12:29:06 -0700 (PDT) Received: from gouda.nowheycreamery.com (d28-23-121-75.dim.wideopenwest.com. [23.28.75.121]) by smtp.gmail.com with ESMTPSA id v23sm16243957ioh.58.2019.08.19.12.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 12:29:06 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH 5/6] NFS: Have nfs41_proc_secinfo_no_name() call nfs4_call_sync_custom() Date: Mon, 19 Aug 2019 15:28:59 -0400 Message-Id: <20190819192900.19312-6-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> References: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker We need to use the custom rpc_task_setup here to set the RPC_TASK_NO_ROUND_ROBIN flag on the RPC call. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1b7863ec12d3..df12af8f6b36 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -9365,18 +9365,32 @@ _nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle, .rpc_resp = &res, }; struct rpc_clnt *clnt = server->client; + struct nfs4_call_sync_data data = { + .seq_server = server, + .seq_args = &args.seq_args, + .seq_res = &res.seq_res, + }; + struct rpc_task_setup task_setup = { + .rpc_client = server->client, + .rpc_message = &msg, + .callback_ops = server->nfs_client->cl_mvops->call_sync_ops, + .callback_data = &data, + .flags = RPC_TASK_NO_ROUND_ROBIN, + }; const struct cred *cred = NULL; int status; if (use_integrity) { clnt = server->nfs_client->cl_rpcclient; + task_setup.rpc_client = clnt; + cred = nfs4_get_clid_cred(server->nfs_client); msg.rpc_cred = cred; } dprintk("--> %s\n", __func__); - status = nfs4_call_sync(clnt, server, &msg, &args.seq_args, - &res.seq_res, RPC_TASK_NO_ROUND_ROBIN); + nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0); + status = nfs4_call_sync_custom(&task_setup); dprintk("<-- %s status=%d\n", __func__, status); put_cred(cred); From patchwork Mon Aug 19 19:29:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 11101733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCA4C14F7 for ; Mon, 19 Aug 2019 19:29:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC88E206C1 for ; Mon, 19 Aug 2019 19:29:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D9agAE3b" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728461AbfHST3J (ORCPT ); Mon, 19 Aug 2019 15:29:09 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:34901 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728415AbfHST3I (ORCPT ); Mon, 19 Aug 2019 15:29:08 -0400 Received: by mail-io1-f66.google.com with SMTP id i22so6856551ioh.2 for ; Mon, 19 Aug 2019 12:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MKe9IJM5w7IAu8fm9oR8ZK0S/jMYLoynIc8LUP6DP9g=; b=D9agAE3bKFHyNmCMv/KGwwrLYVU1Im6veVcpn6s5kPz3x85wpRTGKxbnJ28bfQERPW szTNZVpnrwDG0WVhCgbJ3xrgp2hIi1Kh/Ge6x95Pp7UTm9VfbtEZcN6Bn+qAWUEXxGHH UfpfNEcjsW5k25RnGU0Of5wHSLpcdZgpSwr67ISoLSu14jAs0bK7eRv+Vm5hgxjhHhJ/ /MWrB9f4lUNyiUfZWiDxS3/QnleKpOvVsnwnTKDg1H8lngKmK1UTANvRmVPiGWZihqQo EaPM/hLkQmOYxBktse9kngppYYvQlX1/HSaJO9sTPwo8rMhu5/tldMgyWXDloltSgjMy ik+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MKe9IJM5w7IAu8fm9oR8ZK0S/jMYLoynIc8LUP6DP9g=; b=c1iWn7AiL6YsYiCnwkWRKGoWmOMElA1w/bQ3/SeZz7ZYfO1bc6tXf2aiyEqPlcODx+ OQnAL5Cj+Mmi/FffmGLvOdNieK5VncuVEjdEwy5sjEimnXjbOl2gb//IRVkKiPm1cfL0 ih+sfrNPzjkIkYTI4ybknYFoukc41pZHUqhm5018Dyd/WKENHIPY+H36DUQXocBZdG/k y0Fe+tuiYbSgBi1ZzrbDPip5LzucMLk/5+3aBAU9b9yc/SWDjVGYXawO5ja4YNJ6U3XI p+wsuDo3/8Ucbt1tJ0+yPLv7lqtCKLDkYUM22Blc3rKUrxTiP4nJF1ftJd2XgDDMTyrx 4oVQ== X-Gm-Message-State: APjAAAVMrUNdL/UxgsquoiqQc5pgNmxoW3KZd6cy+RUvBAMgrMo5nVoY Ora5J2gwwHje9ORYwI6V72o= X-Google-Smtp-Source: APXvYqxHs7rKIkgH6hJT032nBH8/lRopF2WBdG+yBDq/yU1j7XfYfBxhRWCkKNMYXg9wy4qJKLIBpw== X-Received: by 2002:a5e:9408:: with SMTP id q8mr10355497ioj.223.1566242947600; Mon, 19 Aug 2019 12:29:07 -0700 (PDT) Received: from gouda.nowheycreamery.com (d28-23-121-75.dim.wideopenwest.com. [23.28.75.121]) by smtp.gmail.com with ESMTPSA id v23sm16243957ioh.58.2019.08.19.12.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 12:29:07 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Cc: Anna.Schumaker@Netapp.com Subject: [PATCH 6/6] NFS: Have nfs4_proc_get_lease_time() call nfs4_call_sync_custom() Date: Mon, 19 Aug 2019 15:29:00 -0400 Message-Id: <20190819192900.19312-7-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> References: <20190819192900.19312-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker This removes some code duplication, since both functions were doing the same thing. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index df12af8f6b36..00c7a92e3d6b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -8356,7 +8356,6 @@ static const struct rpc_call_ops nfs4_get_lease_time_ops = { int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo) { - struct rpc_task *task; struct nfs4_get_lease_time_args args; struct nfs4_get_lease_time_res res = { .lr_fsinfo = fsinfo, @@ -8378,17 +8377,9 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo) .callback_data = &data, .flags = RPC_TASK_TIMEOUT, }; - int status; nfs4_init_sequence(&args.la_seq_args, &res.lr_seq_res, 0, 1); - task = rpc_run_task(&task_setup); - - if (IS_ERR(task)) - return PTR_ERR(task); - - status = task->tk_status; - rpc_put_task(task); - return status; + return nfs4_call_sync_custom(&task_setup); } #ifdef CONFIG_NFS_V4_1