From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 76C8022339 for ; Sun, 8 Feb 2026 08:20:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770538807; cv=none; b=fdQWqgMwpLueCrOabKOWkujQcqrQrfQRvDKdTwXUidUDof19tqr7XWWMQ1pfihbAotNGKzErvA8QK0jEJZpEJR3F1JFqT7fJ6uOqlmFcndpSSaXAlqEYoS5Hp4Mnq87hu9lZwGGRqK9CaA89jm3cYt2F7XUT5MDqml+sW19KU4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770538807; c=relaxed/simple; bh=yPULjpKZW4FJPOuBo2KvgPDT9UctVJ7ppi+I3JMD1fE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HQcWHWuvRhiNOG53uG6uvMWuEQX7COdJ5Bp+D9X5iQH0ei3jWyfdX5dqMUlK+n6cKZ6SrIly3wJoOWr0um8PdXBFSQ2GHUQrKwT4AiBiCkSgqYH55p2I43ESMiDs6RzU3xeb4ffKAHpk4oiQcGC44BUsZEq+ljj/f/bWYDnnGac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kVlZ3FxJ; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kVlZ3FxJ" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-4359249bbacso2468072f8f.0 for ; Sun, 08 Feb 2026 00:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770538806; x=1771143606; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AA+LxrfEqBJCeppYnfBQMgProGOSges9FPVZZ3/gDXc=; b=kVlZ3FxJZcR0/CTc6q4Z3AK+77x66Nj/JVVKJDjthDzmUeBxaXHfopJgpV55PFTCAF ISYq+JLk//9m7QSFjrX+fuBUJwFNVDmxJvF+b7WBl5p+qHKscp6uy8SY7W6r91Y7uF6v cjbhYPRmmOKU78h44aNRoaptCrIdjlMVr5RZ9EcIsdDo7quYC86qQDKQvuR+4oyYE2Wn Z2rZyvHU6/qvygUZ/zT7cM/XNBNpzUkrDOVlyUaM2piufbwKwzpDi6sopbccGqxdCNxX JA0ZYHBcooeOCfroD75OjMLk1waXWeBDzUD2V02UlFJ8rbMBklgdCl2NdeYRHfuj1Vuz QdDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770538806; x=1771143606; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AA+LxrfEqBJCeppYnfBQMgProGOSges9FPVZZ3/gDXc=; b=ZlnfMpeyup13RnYf1qrLVPnssp7oW8uBfojH+tufVmX42C2NcXk9fR9EJ+rOqVTn3Q D2e4sxeIPBwoUW0LQJDIovBY/9ZumXLE0diYY4ORRSjKa/LQi7MnTDczp3l+qxPi0u6L FbxbVRoojRs5w70kvpLQ7+Psah9Om09me0rdOLgpq44A47FGzdsKZncrjxfdZq6XrEj/ otFQ7aWpbWEEzo7O7BDFddDPvwNsaN9wc2KXJZ4Vt/ICzO6iXR+q06NDbVKtXcAJlT0H oe+SFcqWp4Y3PRI32rq0cLuFJZkquXPLTlJ/+Lue3J6gLptI+S9wxsIwikDMxLPH27Py Mq4g== X-Gm-Message-State: AOJu0Yx/o/E6mXiSg3uACm0/r2fozIOpiQOBtbySddOcBb9MUP3S50Ys IDnaGyR1TbC0Zxz321FzqLDxFDJt2hnCBth4jXe43YXNmA8L+jUa2FbK X-Gm-Gg: AZuq6aKq8oH4wMr8S8s9xiMEkxZiJgnIuN1+9EYmG2WTa5C3+4sIS0UzUpCsEMZ45Ld J5dpXBzi2P5DBBfJJYNM9enNVPsjIkexMzDoNieHOXmn6N9uGTz7HswXLOOefNay/snntJGnPZy +PPuFWuw9cKhaBRWigLJwmsfUySpU8KP5M/KTRNhwx8sPgZ0fb1xLBVb+8ltNxxb4ta343jxASO dqJRLsQ6VuDiygSjZsXoXY9OoFJfoHLP25Lq34F4M0v+vy3KZK37jIIsE3pRcYy9/ht0zS7CRbD TlcV+PHpVaDJE9nvXtmTVjPZSc9vAoGhIzR0KP6xsN6gOz2K4qy8bud/bCMPP2ROC7OIKaqYzv+ 0FIsdXVywmZRhbUiS6ZDgU+9+heegFqB9GunGuZf6JbAL3eTix0TsI6s4QFk34Y8ZimtIuo9FYf 11mehm3SF0HvSdMPNJPTj4zpKZAmt6Lzre4ZUOJofeuasb9z7fgq1/CA== X-Received: by 2002:a5d:5d89:0:b0:435:9a18:5a29 with SMTP id ffacd0b85a97d-436209966ddmr20697343f8f.11.1770538805560; Sun, 08 Feb 2026 00:20:05 -0800 (PST) Received: from ?IPV6:2a01:5a8:304:153c:3ab3:7a9:6529:7104? ([2a01:5a8:304:153c:3ab3:7a9:6529:7104]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43629754c62sm16678514f8f.38.2026.02.08.00.20.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Feb 2026 00:20:05 -0800 (PST) Message-ID: <20d908f6-14ff-42dd-9e09-1b0c997efe6e@gmail.com> Date: Sun, 8 Feb 2026 10:20:04 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] jfs: Check for discrepancies between iag and inomap iagctl To: shaggy@kernel.org, dmantipov@yandex.ru, quic_zhonhan@quicinc.com, eadavis@qq.com, jfs-discussion@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org, syzbot+d569e274f46ca86f78fa@syzkaller.appspotmail.com References: <20260102184849.1932768-1-zlatistiv@gmail.com> Content-Language: en-US From: "Nikola Z. Ivanov" In-Reply-To: <20260102184849.1932768-1-zlatistiv@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/2/26 8:48 PM, Nikola Z. Ivanov wrote: > syzbot reports "VFS: Busy inodes after unmount" which is caused > by a deadlock in the jfsCommit thread, in a call to diFree. > > The filesystem from the syz repro can be used to reproduce the > deadlock by mounting it, deleting a file and running "sync" or > unmounting the filesystem. Running "fsck" on the filesystem > image seemingly fixes the inconsistency and we no longer deadlock. > > This happens because the IAG that contains the inode we are > freeing is head of the free list, but also holds nfreeinos = 0, > which will lead to a deadlock when we try to add it as head > of the free list, since it already is head of the list. > > Fix this by adding a check for the discrepancy before > reading more metapages that could potentially match with "mp". > Do the same for the extent free list as it may lead to a > similar deadlock. > > Reported-by: syzbot+d569e274f46ca86f78fa@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=d569e274f46ca86f78fa > Signed-off-by: Nikola Z. Ivanov > --- > fs/jfs/jfs_imap.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c > index ecb8e05b8b84..fd9f9babaf46 100644 > --- a/fs/jfs/jfs_imap.c > +++ b/fs/jfs/jfs_imap.c > @@ -902,6 +902,25 @@ int diFree(struct inode *ip) > } > iagp = (struct iag *) mp->data; > > + /* We will deadlock if due to inconsistency > + * the iag has no free inodes/extents but is > + * head of the respective free list > + */ > + if (iagp->nfreeinos == 0 && imap->im_agctl[agno].inofree == iagno) { > + IREAD_UNLOCK(ipimap); > + AG_UNLOCK(imap, agno); > + release_metapage(mp); > + jfs_error(ip->i_sb, "nfreeinos = 0, but iag is head of freelist\n"); > + return -EIO; > + } > + if (iagp->nfreeexts == 0 && imap->im_agctl[agno].extfree == iagno) { > + IREAD_UNLOCK(ipimap); > + AG_UNLOCK(imap, agno); > + release_metapage(mp); > + jfs_error(ip->i_sb, "nfreeexts = 0, but iag is head of freelist\n"); > + return -EIO; > + } > + > /* get the inode number and extent number of the inode within > * the iag and the inode number within the extent. > */ Hello, Kindly sending a reminder on this in case this slipped through the cracks. In case jfs is at the point where syzkaller bugs are not worth the effort please let us know since I was unable to find a definitive answer in the mail archive. Thank you!