Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3556212pxb; Mon, 24 Jan 2022 12:08:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/QZGPeR6LPxZImgKnKzw+BGp/hZHwWCRwJiftG0ox2BoMB2DWy6BIiD+di8l76EpGZaij X-Received: by 2002:a05:6a00:228c:b0:4c3:40a:74c6 with SMTP id f12-20020a056a00228c00b004c3040a74c6mr15465277pfe.32.1643054905823; Mon, 24 Jan 2022 12:08:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054905; cv=none; d=google.com; s=arc-20160816; b=UICCBxpnv8bxbkSTGwTi1Y5yROaTIRH0S95+uRw25F1nMbXgaavXSVpUjwudmOV1li Q5RcA8AvqErV+d36E/7xd3hLNYYaceA7S84gtWHxYoMYvutPRrHbglg3/gFKJ1h9CkDz pKR4pO1BiNCcekYNfhob4CpCh/o4YYcapPnFk3/yywqKWbhPDXTMjSDpxUCPXgYzlULv XLpvTITr1/cHZu2cndvwEtxVCSH1MOhLHDLhshFzwFMJakXNN2XIFaXjvhAm15H4MW9J EodGbRdvDQSGmR8bCPasurPD2z72SU9D+ib4EZAF67i61cYAFfmX/e7BatgTdzVTINLC 5RqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bhyieNS/LjJfPOiv47IaE6+kwae8lgSX2Llxcp+FMxs=; b=E0OYTSymTbsLkKIogs4UwPC1U2HsHO6Viz6a8h8JW+f1W84ZwAp6HscgvvAKPTxmhh AcpqDuO4p4nfOAUQ++7Ad3qVHdFP221DzBBfw+7eLZ7iCRo2aywO/QVkBsItZCdzKgZS rB7EDSp9H4fr2dlPEut/ubbE93X/NETO8si8ESckSaenaVQ2Qz8j/5CC0LTBgjGMe+CK jem/reXhkkDniBhTU2j0G8DH02q1sWsfSuDvbKnqGbPveP8Yb0W9/RFonchgU6LbIRRh 4dwWHsMNC+hAm78O3iIicrqh0LcTrYrangIl1BgpMXYXwsdIWMa4KzEyP5R+/9ERJOzD SbTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t99amihw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx10si314867pjb.162.2022.01.24.12.08.12; Mon, 24 Jan 2022 12:08:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t99amihw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346437AbiAXTFd (ORCPT + 99 others); Mon, 24 Jan 2022 14:05:33 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:59202 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345572AbiAXTAa (ORCPT ); Mon, 24 Jan 2022 14:00:30 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5CD7E609EE; Mon, 24 Jan 2022 19:00:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F860C340E5; Mon, 24 Jan 2022 19:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050829; bh=8tY+An6URUoVV/3dDVrzPaBtt69kSBA3mgynBIRuVoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t99amihwz5CPaIZEFMBJZlbW/mF1ZNISRA9BZUpd1qbqBt1YnCbHT+Nm3aGhGnoZm hs2OHFkFq7+PZeoRa/rfkcR9+uoMQXqNw9Q42fGgb8R9U6e+gvnoPBcAZHZf1p9vVh ZnXhfRPlmTDoC2dX2PhAvx0DHS7dvUh+jKs/anuU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amir Goldstein , Miklos Szeredi , Ben Hutchings Subject: [PATCH 4.9 126/157] fuse: fix live lock in fuse_iget() Date: Mon, 24 Jan 2022 19:43:36 +0100 Message-Id: <20220124183936.775591737@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amir Goldstein commit 775c5033a0d164622d9d10dd0f0a5531639ed3ed upstream. Commit 5d069dbe8aaf ("fuse: fix bad inode") replaced make_bad_inode() in fuse_iget() with a private implementation fuse_make_bad(). The private implementation fails to remove the bad inode from inode cache, so the retry loop with iget5_locked() finds the same bad inode and marks it bad forever. kmsg snip: [ ] rcu: INFO: rcu_sched self-detected stall on CPU ... [ ] ? bit_wait_io+0x50/0x50 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ? find_inode.isra.32+0x60/0xb0 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ilookup5_nowait+0x65/0x90 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ilookup5.part.36+0x2e/0x80 [ ] ? fuse_init_file_inode+0x70/0x70 [ ] ? fuse_inode_eq+0x20/0x20 [ ] iget5_locked+0x21/0x80 [ ] ? fuse_inode_eq+0x20/0x20 [ ] fuse_iget+0x96/0x1b0 Fixes: 5d069dbe8aaf ("fuse: fix bad inode") Cc: stable@vger.kernel.org # 5.10+ Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- fs/fuse/fuse_i.h | 1 + 1 file changed, 1 insertion(+) --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -692,6 +692,7 @@ static inline u64 get_node_id(struct ino static inline void fuse_make_bad(struct inode *inode) { + remove_inode_hash(inode); set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state); }