Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1442299lqd; Thu, 25 Apr 2024 16:19:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3SacFDjlfzXzeaPw11BcXakTKAMMFlo00zblky03z8DDUGJNKAM4A0bqvLNlBsOEC937S4xCBM9bWH/mIG0w+HG2N5DR6gw1h6jK98A== X-Google-Smtp-Source: AGHT+IF5fwPEVAtUnn6xYtHqDjZ1FGz6vILKYDZX/p7Cb4HY7t1uwWH/oXB8G4Wr90ybctYBA8CX X-Received: by 2002:a17:90b:358b:b0:2a0:3a16:7489 with SMTP id mm11-20020a17090b358b00b002a03a167489mr1046025pjb.44.1714087141352; Thu, 25 Apr 2024 16:19:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714087141; cv=pass; d=google.com; s=arc-20160816; b=e5rVvd4QTr8JjH20bHqEtHAYLfU1vkIVb7SIuDRMBz7X0AMnOyV4uKvmR+bGCcE+KN tdpNEABEoL8T7FyNpUKO7w18G76IjP3NCsc3by861b9xpAoUDG+UKv9cyS+yjv1YSWCi IQ/IyGwuTDJlpRuxYI+7xKi/I23t3HR19rP2G549clYofukirDLF4zr8hDw6tURhs/ue +bhT3c1xBvWKdfk91W3i09DTvSjdyjMWzp7cYw1IEGqJHuMJLEEwZQtyDZQHeYCOuGcG Y9fuf9F7NF6cs+cpULMILmXf0v95IywfFUedHOpXD+orZNEgjhnpc8aWujmNTReXwAIh gD/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:references:in-reply-to: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=52y5sBbq6yd4cZWzlgqBhsOglWePkg8NYEXLDnSj9n0=; fh=eoOQfiZBSl6m16ol2j5HEcG6rNGLSn2eBCVX+4KcIvY=; b=FdH0tj+CqTTH/OoEMnqqimPK83hNPgSa1HaVT3NEJPp7Z89OnT6LV+qFjovf/BZZKU mNz5ZX3kVFTL1EcpCnGuuKvEV6p2F189g/KmzR7xlRqZxNjbIYCRaDaqASKVk7C+UcMQ l/2pWH+RnhhsRSNJPwajrWVWc8XHZ13cLYbiEt5P/7IjnwCNPgIkVwc3C+mSibUGB9Hx rQZZhvnSMAN9ceBjy2inTsmiNs2iYpWo0IsGWB3ag/NpZPCV5UNnUn0eNvX1gROTndq+ d0Jhny7CRCzUg71WLiOsXq5zNOajJcnvJTh8frYuDN69E6zH85McxM1VfTNA4+PPOP66 Eq0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=zJuxruLY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ckJTeLLE; 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-3015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e89-20020a17090a6fe200b002a244f3f90bsi13897557pjk.107.2024.04.25.16.19.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 16:19:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=zJuxruLY; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=ckJTeLLE; 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-3015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3015-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 82D8D28524F for ; Thu, 25 Apr 2024 23:19:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 385F1156655; Thu, 25 Apr 2024 23:18:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="zJuxruLY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="bNdYA6J/"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="ckJTeLLE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="truHWJsK" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 67F9684D0D; Thu, 25 Apr 2024 23:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714087137; cv=none; b=tMqAPFF6XR5E8yYKahh345NmoVeCBUBHeu6BfhekxPtjutwwLP+dPgti1SPjL6AiLmCvpYqv94eYPzw2mSo9e/Dftq9FFVSEF32iQHszqZMVqmlI5E0fDQ81h2wrvv52F84VCLdoRiHEae4JbZZIDnVeOaa1sq05z7yVAjvDq4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714087137; c=relaxed/simple; bh=f7B8+aI+858znS4N0tv3mXyDzuhtmEEsi7y/rHt+Ngg=; h=Content-Type:MIME-Version:From:To:Cc:Subject:In-reply-to: References:Date:Message-id; b=tcbDVVg7eJ1vIsBZlSwFNYxNfo2oSdf/8QkL+ovBUvF8hpTUlcpxHh7SuezgadklW6Kb6ttOSao2v2YV5RfeHD70CXGfl1eQ76PBYzzH6uH8h3MBTl4InB/RvfhNPKfsVSHPIOk+HrSqOkkNqZFRqr2ZtZJrLxnuMibxtcD3jwg= 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=zJuxruLY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=bNdYA6J/; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=ckJTeLLE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=truHWJsK; arc=none smtp.client-ip=195.135.223.130 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 [IPv6:2a07:de40:b281:104: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-out1.suse.de (Postfix) with ESMTPS id D80BD345E7; Thu, 25 Apr 2024 23:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714087128; 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: in-reply-to:in-reply-to:references:references; bh=52y5sBbq6yd4cZWzlgqBhsOglWePkg8NYEXLDnSj9n0=; b=zJuxruLY+3JmcsK93MONqBjx88QO12qF0HxR8MD+Dqt77S0gjupa3fk6GBCAeKLhFePGJF 4D+rmmlZLXIy7Uf/7QX1Cd8MQZDNK49gmIIrhvOTVpvjamEGheBDcu1XpNTKh6KDA8QfND N7kRtQU+Fko8SOvbR3LBXB+mVB5+7gI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714087128; 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: in-reply-to:in-reply-to:references:references; bh=52y5sBbq6yd4cZWzlgqBhsOglWePkg8NYEXLDnSj9n0=; b=bNdYA6J/5fTjQwrU6+XbSnWrOQt1XJ35F8Zxe2Tf8he2hXyxVDQV2ZvWSsXOSNiZhGIFJd v5cm3xrTeI/OlcCg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ckJTeLLE; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=truHWJsK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714087127; 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: in-reply-to:in-reply-to:references:references; bh=52y5sBbq6yd4cZWzlgqBhsOglWePkg8NYEXLDnSj9n0=; b=ckJTeLLE28orgl8rFbmFAyUy5dYrotZueK/jUcfFlThwyFmZ5SURkJfzzjFS3ctbP3kl2+ p+LWAP010gsmbY6NZdys1NcFH3l6D2DFpBwm8busNpI6VYQjzS8C3V24XrdRdNRlGReySm 720ayNBM3rCYieiUTxUAQO8klAvyT0o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714087127; 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: in-reply-to:in-reply-to:references:references; bh=52y5sBbq6yd4cZWzlgqBhsOglWePkg8NYEXLDnSj9n0=; b=truHWJsKYvh1OjfIMk/frIJqe4Kbb5eJinIys2r56Unm1a0khg86+kviit8839ArDNpz1e th8hSwaTdyeiYaDQ== 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 8AD391393C; Thu, 25 Apr 2024 23:18:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id oXnAC9TkKmbQCQAAD6G6ig (envelope-from ); Thu, 25 Apr 2024 23:18:44 +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: "Chris Packham" Cc: "Chuck Lever III" , "Jeff Layton" , "Greg Kroah-Hartman" , "Linux NFS Mailing List" , "netdev" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: kernel BUG at net/sunrpc/svc.c:570 after updating from v5.15.153 to v5.15.155 In-reply-to: <141fbaa0-f8fa-4bfe-8c2d-7749fcf78ab3@alliedtelesis.co.nz> References: <>, <141fbaa0-f8fa-4bfe-8c2d-7749fcf78ab3@alliedtelesis.co.nz> Date: Fri, 26 Apr 2024 09:18:40 +1000 Message-id: <171408712052.7600.17665015984185673222@noble.neil.brown.name> X-Spam-Flag: NO X-Spam-Score: -4.51 X-Rspamd-Action: no action X-Rspamd-Queue-Id: D80BD345E7 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,oracle.com:email]; DKIM_TRACE(0.00)[suse.de:+] On Fri, 26 Apr 2024, Chris Packham wrote: >=20 > On 25/04/24 11:37, NeilBrown wrote: > > On Thu, 25 Apr 2024, Chuck Lever III wrote: > >>> On Apr 24, 2024, at 9:33=E2=80=AFAM, Chuck Lever III wrote: > >>> > >>>> On Apr 24, 2024, at 3:42=E2=80=AFAM, Chris Packham wrote: > >>>> > >>>> On 24/04/24 13:38, Chris Packham wrote: > >>>>> On 24/04/24 12:54, Chris Packham wrote: > >>>>>> Hi Jeff, Chuck, Greg, > >>>>>> > >>>>>> After updating one of our builds along the 5.15.y LTS branch our > >>>>>> testing caught a new kernel bug. Output below. > >>>>>> > >>>>>> I haven't dug into it yet but wondered if it rang any bells. > >>>>> A bit more info. This is happening at "reboot" for us. Our embedded > >>>>> devices use a bit of a hacked up reboot process so that they come back > >>>>> faster in the case of a failure. > >>>>> > >>>>> It doesn't happen with a proper `systemctl reboot` or with a SYSRQ+B > >>>>> > >>>>> I can trigger it with `killall -9 nfsd` which I'm not sure is a > >>>>> completely legit thing to do to kernel threads but it's probably close > >>>>> to what our customized reboot does. > >>>> I've bisected between v5.15.153 and v5.15.155 and identified commit > >>>> dec6b8bcac73 ("nfsd: Simplify code around svc_exit_thread() call in > >>>> nfsd()") as the first bad commit. Based on the context that seems to > >>>> line up with my reproduction. I'm wondering if perhaps something got > >>>> missed out of the stable track? Unfortunately I'm not able to run a mo= re > >>>> recent kernel with all of the nfs related setup that is being used on > >>>> the system in question. > >>> Thanks for bisecting, that would have been my first suggestion. > >>> > >>> The backport included all of the NFSD patches up to v6.2, but > >>> there might be a missing server-side SunRPC patch. > >> So dec6b8bcac73 ("nfsd: Simplify code around svc_exit_thread() > >> call in nfsd()") is from v6.6, so it was applied to v5.15.y > >> only to get a subsequent NFSD fix to apply. > >> > >> The immediately previous upstream commit is missing: > >> > >> 390390240145 ("nfsd: don't allow nfsd threads to be signalled.") > >> > >> For testing, I've applied this to my nfsd-5.15.y branch here: > >> > >> https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git > >> > >> However even if that fixes the reported crash, this suggests > >> that after v6.6, nfsd threads are not going to respond to > >> "killall -9 nfsd". > > I think this likely is the problem. The nfsd threads must be being > > killed by a signal. > > One only other cause for an nfsd thread to exit is if > > svc_set_num_threads() is called, and all places that call that hold a > > ref on the serv structure so the final put won't happen when the thread > > exits. > > > > Before the patch that bisect found, the nfsd thread would exit with > > > > svc_get(); > > svc_exit_thread(); > > nfsd_put(); > > > > This also holds a ref across the svc_exit_thread(), and ensures the > > final 'put' happens from nfsD_put(), not svc_put() (in > > svc_exit_thread()). > > > > Chris: what was the context when the crash happened? Could the nfsd > > threads have been signalled? That hasn't been the standard way to stop > > nfsd threads for a long time, so I'm a little surprised that it is > > happening. >=20 > We use a hacked up version of shutdown from util-linux and which does a=20 > `kill (-1, SIGTERM);` then `kill (-1, SIGKILL);` (I don't think that=20 > particular behaviour is the hackery). I'm not sure if -1 will pick up=20 > kernel threads but based on the symptoms it appears to be doing so (or=20 > maybe something else is in it's SIGTERM handler). I don't think we were=20 > ever really intending to send the signals to nfsd so whether it actually=20 > terminates or not I don't think is an issue for us. I can confirm that=20 > applying 390390240145 resolves the symptom we were seeing. >=20 >=20 Makes sense - thanks. "kill -1 ..." does send the signal to *every* process including kernel threads. I'm glad you weren't depending on that to kill nfsd. Hopefully no one else is. I think the best way forward is to apply that patch to 5.15-stable as Chuck plans to do. Thanks, NeilBrown