Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2092502ybp; Thu, 10 Oct 2019 02:03:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjj6LA2khO6QJ2NSeVNmol3tadckWskmaIDgZDLpJCfrBwgY/ghpS4oJO+qwFV5UdhGsUx X-Received: by 2002:a17:906:5407:: with SMTP id q7mr7206856ejo.24.1570698220225; Thu, 10 Oct 2019 02:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570698220; cv=none; d=google.com; s=arc-20160816; b=umzRSGCVpfL3K0Pj4EVN9T8k2SqKqicgiOdK9i4SH45kJItI7gd6RvhG4bv4qXmqh6 mYOFPyI1oT/RJUk0bstz1kquaxa3Q+FrKf7r+VeMnWcU6+TKUYDb1gkn4lKmst+bJKD+ D/vJRtzoGyn798VRz+nIHsIX+V7g7BDtW+o9CNJX9DKGfPQ3dqJs3MaURB/MRETeSd6I tW/2KVCcwR8ltHzVZz+PFggZS0ehzhJ3ZBuEoA19CPIzYyIT3f+hAn1/x1eTwDmRfLdY c3Kgu1jy6e5cz7uECWzukQ2hblC2yBx+8X/33ZFlCLjyQuU1QOIGDzK0p/jcz1gNdeKc 0dKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6HAVJgBw8O3ABKLd/ZIDrYJczw/fATqbPnN4I3BZ4eE=; b=mO46xGEvOG3DLHOalNJKD/nqrGV3Q5fsUw8LYLmKJXwxEy/5cooEXiF4DJBou3J3Y2 UDq5rrmkDfO48M2wIGGhWeiyXC+J2jEftRQTy0T0dPoWWaYptqSAezdiIwpzcjkKKRV7 l4U7HIV++xaTPdUeklZt3HNvDV1jUr43ODvOX+Vmb29Ax4mCt9yzUHLDyJL4BKvO+B2J mjenKch67+53W0LVolKPLIp/alP0/GjkMgbyizgVAaSb6/tQmVymxfvoyj/8GH4xM4eC Ssswn5uQ+gqSFdQ3WGKgJtDZROLdNh2ZxXMS4TO6jYs7gNGXrDaw66zeAjwhifOkfeSC nMOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1NdUqPlj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si3076096edc.202.2019.10.10.02.03.17; Thu, 10 Oct 2019 02:03:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1NdUqPlj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388505AbfJJJBF (ORCPT + 99 others); Thu, 10 Oct 2019 05:01:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388451AbfJJImA (ORCPT ); Thu, 10 Oct 2019 04:42:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDDDD2190F; Thu, 10 Oct 2019 08:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696920; bh=6mUDVz+V8A+YajlAGgRR43msclML2hmI0m4Bue6sju8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1NdUqPljWeP957wfD9qw+YKss2+gw9WpI2nbSENrYcvKLl6qeGfHNeLSHEYxDgd9b uXita0qjpqgwjeJ1tP1y+T7m1jOEO8KzLUXgknZfm4Qkx+/q91pOAvXUmYer8rXX2j 3JnBtWO19L0vwRdEmsstwDgKe1Z5jYfcs8Yfouns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [PATCH 5.3 101/148] SUNRPC: RPC level errors should always set task->tk_rpc_status Date: Thu, 10 Oct 2019 10:36:02 +0200 Message-Id: <20191010083617.350460632@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust [ Upstream commit 714fbc73888f59321854e7f6c2f224213923bcad ] Ensure that we set task->tk_rpc_status for all RPC level errors so that the caller can distinguish between those and server reply status errors. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- net/sunrpc/clnt.c | 6 +++--- net/sunrpc/sched.c | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 7a75f34ad393b..e7fdc400506e8 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1837,7 +1837,7 @@ call_allocate(struct rpc_task *task) return; } - rpc_exit(task, -ERESTARTSYS); + rpc_call_rpcerror(task, -ERESTARTSYS); } static int @@ -2561,7 +2561,7 @@ rpc_encode_header(struct rpc_task *task, struct xdr_stream *xdr) return 0; out_fail: trace_rpc_bad_callhdr(task); - rpc_exit(task, error); + rpc_call_rpcerror(task, error); return error; } @@ -2628,7 +2628,7 @@ rpc_decode_header(struct rpc_task *task, struct xdr_stream *xdr) return -EAGAIN; } out_err: - rpc_exit(task, error); + rpc_call_rpcerror(task, error); return error; out_unparsable: diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 1f275aba786fc..53934fe73a9db 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -930,8 +930,10 @@ static void __rpc_execute(struct rpc_task *task) /* * Signalled tasks should exit rather than sleep. */ - if (RPC_SIGNALLED(task)) + if (RPC_SIGNALLED(task)) { + task->tk_rpc_status = -ERESTARTSYS; rpc_exit(task, -ERESTARTSYS); + } /* * The queue->lock protects against races with @@ -967,6 +969,7 @@ static void __rpc_execute(struct rpc_task *task) */ dprintk("RPC: %5u got signal\n", task->tk_pid); set_bit(RPC_TASK_SIGNALLED, &task->tk_runstate); + task->tk_rpc_status = -ERESTARTSYS; rpc_exit(task, -ERESTARTSYS); } dprintk("RPC: %5u sync task resuming\n", task->tk_pid); -- 2.20.1