Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2323116rbb; Tue, 27 Feb 2024 19:48:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUmJpr4icbG+Y2PFtZo9qadFDVbUHsmEWLZr7t/BOvlfHJKFmZ2i4Up5wv58/KXhL9ICIugUMPkuv3LK1RAHlQSKS9hSSMNwPBjs3YFBg== X-Google-Smtp-Source: AGHT+IG4dWC5sgTCyP/FMltRzJxgDA/O5H+Npo1FnrPAW2z1W9Zjo0ci9B5Cu09EXytly/WCBI5r X-Received: by 2002:a05:6512:1114:b0:512:cba9:c5e with SMTP id l20-20020a056512111400b00512cba90c5emr8640609lfg.61.1709092114339; Tue, 27 Feb 2024 19:48:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709092114; cv=pass; d=google.com; s=arc-20160816; b=kN/8hIUzdIgiYfzLr7A6Qidli4trhLhlM3DQSqnPVCkW1twokDKeFy444hjttxUWcO EyJJT8db560sg7BJi9IxGJUQa7I/kkI+Xd4Wrq/11oA9XFmc1wOc2voGwxXdW250InxG Lmg9tXm/m9trIdWxiW47MNZUiIZk4QynY0+fEn7Cq5bkfuw1LVfBoMBge1eEyfw6zATh FzYKzXRB9sT9iJoDULz/ExDtOlSZVAO5TBnm3K6zTsElEIqCUy/1c1uYUD7pNVnprNt1 8cyNSfnyCSZNWTa9bSku+cNT/Qqjc17X4QKbIuourBn/e19QH/oAoyiM6wweEq5Uux9H jfNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:content-transfer-encoding :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=t9sTw1PRmiNuisHTI3BarLYfTjqSvjbDL11Ef7Irnz8=; fh=GifyqFa99IsdZU6nfXwdlapcmcifmRlgg5abxGVybIY=; b=bBo+FMKNgjqIgsv7+82mYM+aRslDnlf13AvWgxjimD/RVZVeAvWjhmcc82EQUdacQq U074zKqJadqLuMmfAss2oTqPm7coYIdPd/AN0DRDxeF91SyABRAljJUjl+H+jwSNC3Yz e1gmrXMaORIhu5ZCUb81VVIKZqlRikNujUq+WEMaA15JK6+TKQfbadHdGcno/h+ApMc2 zVeczOKLEbAuoO/QYDCoXWLlVCM4gDPSjlfCSNYUJDGORFhSqVuRpXPc84fWyHmMzWny QCmXU0cIK4cQzshdkyS3SV2Wx7be/v1nPjRwxFxEG61c+lb4837YwvuypfMwRWb9S9vN zTxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KNmHzAgm; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KNmHzAgm; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-2106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id pv14-20020a170907208e00b00a4335ba4b32si1300343ejb.51.2024.02.27.19.48.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 19:48:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KNmHzAgm; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KNmHzAgm; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-nfs+bounces-2106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D97891F259E1 for ; Wed, 28 Feb 2024 03:46:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7D7B200DD; Wed, 28 Feb 2024 03:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KNmHzAgm"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="WppRTDEu"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="KNmHzAgm"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="WppRTDEu" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E564200BF for ; Wed, 28 Feb 2024 03:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709092008; cv=none; b=ttsphkjGHlNjQo6vXxMsQweCJ9UN4Dm7/nhJVwwTUD/8hGI9BkjlDSXThBjwZC/qHy5YWWLNf3GeqA+i7P76Tw+Iw6gnMIfKeLFn9JOVzkJWNOY5uHo9UTKX9nX2MVQ/LHinsn1+spJj0WHpa6xH2H0gVtqMe3VtDkiroyIOATc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709092008; c=relaxed/simple; bh=yvKas0Ab0XqYUA75hi1epw5HhhTsDkJnbY7CNh6OKQw=; h=Content-Type:MIME-Version:From:To:Cc:Subject:Date:Message-id; b=FWPM6miRrHzy8VY3WqR8e6qnRJwELYWpYjizoTzbD1kdTARLG0y/EWPTs5IY23weq76BrbpqGBLT1J4+ysYOcf1oZQffhLLAYWpWfIBpOUuIq/MV8a1PVQzZ9GeIhRfiFl74dwIhHC8jLtC6I4dDaLR0v2z3ixSO2tWDbzFVhMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=KNmHzAgm; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=WppRTDEu; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=KNmHzAgm; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=WppRTDEu; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6C4D51FDD1; Wed, 28 Feb 2024 03:46:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709092004; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9sTw1PRmiNuisHTI3BarLYfTjqSvjbDL11Ef7Irnz8=; b=KNmHzAgmBwvHXWF9wLphN/9FP++bsj3Z+8o+dhfK975GdGdgesujiPD+bfCBNRPR2c6mEb y0/zJJHuXCg43XxjN/PUGnfKGpjSuF5/5JZMdQNe/OmNAnljktKw9Zyc/0xuF5Iu/i9xMI txDgjjiIats8rHBkjyLMJAOxOuRvfjU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709092004; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9sTw1PRmiNuisHTI3BarLYfTjqSvjbDL11Ef7Irnz8=; b=WppRTDEukzhD6tDnd4mRpVkz/uz86sjdfREeWP3x+ag+LB4FUfo7qSgvvaspQFTz02w+yb t/wqoK/pa2W/LXAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709092004; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9sTw1PRmiNuisHTI3BarLYfTjqSvjbDL11Ef7Irnz8=; b=KNmHzAgmBwvHXWF9wLphN/9FP++bsj3Z+8o+dhfK975GdGdgesujiPD+bfCBNRPR2c6mEb y0/zJJHuXCg43XxjN/PUGnfKGpjSuF5/5JZMdQNe/OmNAnljktKw9Zyc/0xuF5Iu/i9xMI txDgjjiIats8rHBkjyLMJAOxOuRvfjU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709092004; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t9sTw1PRmiNuisHTI3BarLYfTjqSvjbDL11Ef7Irnz8=; b=WppRTDEukzhD6tDnd4mRpVkz/uz86sjdfREeWP3x+ag+LB4FUfo7qSgvvaspQFTz02w+yb t/wqoK/pa2W/LXAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8221B13A92; Wed, 28 Feb 2024 03:46:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id KOoMCaKs3mVRZgAAD6G6ig (envelope-from ); Wed, 28 Feb 2024 03:46:42 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "NeilBrown" To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, Zhitao Li Subject: [PATCH] NFS: Restore -EIO as error to return when "umount -f" aborts request. Date: Wed, 28 Feb 2024 14:46:38 +1100 Message-id: <170909199843.24797.6320949640369986924@noble.neil.brown.name> Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-0.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -0.10 When "umount -f" is used to abort all outstanding requests on an NFS mount, some pending systemcalls can be expected to return an error. Currently this error is ERESTARTSYS which should never be exposed to applications (it should only be returned due to a signal). Prior to Linux v5.2 EIO would be returned in these cases, which it is more likely that applications will handle. This patch restores that behaviour so EIO is returned. Reported-and-tested-by: Zhitao Li Closes: https://lore.kernel.org/linux-nfs/CAPKjjnrYvzH8hEk9boaBt-fETX3VD2cjjN= -Z6iNgwZpHqYUjWw@mail.gmail.com/ Fixes: ae67bd3821bb ("SUNRPC: Fix up task signalling") Signed-off-by: NeilBrown --- include/linux/sunrpc/sched.h | 2 +- net/sunrpc/clnt.c | 2 +- net/sunrpc/sched.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 2d61987b3545..ed3a116efd5d 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -222,7 +222,7 @@ void rpc_put_task(struct rpc_task *); void rpc_put_task_async(struct rpc_task *); bool rpc_task_set_rpc_status(struct rpc_task *task, int rpc_status); void rpc_task_try_cancel(struct rpc_task *task, int error); -void rpc_signal_task(struct rpc_task *); +void rpc_signal_task(struct rpc_task *, int); void rpc_exit_task(struct rpc_task *); void rpc_exit(struct rpc_task *, int); void rpc_release_calldata(const struct rpc_call_ops *, void *); diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index cda0935a68c9..cdbdfae13030 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -895,7 +895,7 @@ void rpc_killall_tasks(struct rpc_clnt *clnt) trace_rpc_clnt_killall(clnt); spin_lock(&clnt->cl_lock); list_for_each_entry(rovr, &clnt->cl_tasks, tk_task) - rpc_signal_task(rovr); + rpc_signal_task(rovr, -EIO); spin_unlock(&clnt->cl_lock); } EXPORT_SYMBOL_GPL(rpc_killall_tasks); diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 6debf4fd42d4..e4f36fe16808 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -852,14 +852,14 @@ void rpc_exit_task(struct rpc_task *task) } } =20 -void rpc_signal_task(struct rpc_task *task) +void rpc_signal_task(struct rpc_task *task, int err) { struct rpc_wait_queue *queue; =20 if (!RPC_IS_ACTIVATED(task)) return; =20 - if (!rpc_task_set_rpc_status(task, -ERESTARTSYS)) + if (!rpc_task_set_rpc_status(task, err)) return; trace_rpc_task_signalled(task, task->tk_action); set_bit(RPC_TASK_SIGNALLED, &task->tk_runstate); @@ -992,7 +992,7 @@ static void __rpc_execute(struct rpc_task *task) * clean up after sleeping on some queue, we don't * break the loop here, but go around once more. */ - rpc_signal_task(task); + rpc_signal_task(task, -ERESTARTSYS); } trace_rpc_task_sync_wake(task, task->tk_action); } --=20 2.43.0