Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1347730pxf; Fri, 19 Mar 2021 05:23:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk+P1I3KJZzbBHDxTf2lhodvGQWAvgJn8/6873jgS7J9+OJNR6iQ+SGac0RcCo6SArN16C X-Received: by 2002:a17:906:71d3:: with SMTP id i19mr4065122ejk.347.1616156615854; Fri, 19 Mar 2021 05:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616156615; cv=none; d=google.com; s=arc-20160816; b=iu1VFZjayXorUESHrsVYRYUxOckazED+SANRyqRU553Q6r4GVBmb9qB+qlNrpVbQd9 7DJxlCyTl54VZe/ClVCvYu6N43VuBqQOXN8Nefnukylm+nk/WlmlPoInHqt8XQCeLwRb vjYAmQW4bn7w9a1c4+vBszG7q9dde4y+UyJzPh7LI0mJ8/qo/4Qh76JURk+ncjP4+NIn 2Pn9tcYa2VqSjjFU8Wg1aCt9E64pHe7RyfbXBn3d+QGXkYgrSTXw+JAzTZtUYj5RwYLA 2MAFZpQbqdjrSEg8rxWJzzLsviggWyndzR41d8JosfJUkpaDRVqheoBP2DHWlcj0Cuk/ VJDQ== 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=C0xUh2jLpVaePS5SCpkiO698l0k0HxIqzgoGIwzYz4E=; b=qWDHABPmhZF/m6NUuxvHExoBwbtNSUFEjIPGCWOV8Vlsyw/mpozp1KGlIvMyQLR46b ZXJ/XEaevVZKXy1v6KQzxCO3FiORLljoQkh7s1/5oboEqVKG11dCz4mxkf/UhYjXW5JQ utS/nQyN8OaN49Pg6nQ9X5PpykABSVsSlI5IWaBEBlfa8buFulWw6HBRfwHFSTg0TIMX xsZNZp24zIiDygZpmPeCpoR2RFmpO9eIpvQKnFH764CaU8QvLOw8FszFLQo4uEDKc0qe 4AbCZMvkLrzrhGm9cMjxBxD6RBUM8kfT1NguFkZIMVam2+eJnfAGkCAGfE5wpAMtPKCB tgBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XQMM4mjU; 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 a20si4471531eda.157.2021.03.19.05.23.11; Fri, 19 Mar 2021 05:23:35 -0700 (PDT) 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=XQMM4mjU; 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 S231656AbhCSMWF (ORCPT + 99 others); Fri, 19 Mar 2021 08:22:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:59618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbhCSMVW (ORCPT ); Fri, 19 Mar 2021 08:21:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A5A364F6C; Fri, 19 Mar 2021 12:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616156471; bh=piqb8IFu8cYpYWKPzRz1pQJeqJ3yVKyHw0s/IpyRvx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XQMM4mjUSEN9WJ6mpMtXH6uq1r8r4qfO3YXs0nt5I5NwDxMhgA5eQ5od4vRMyGXH4 JIFcGu/hQGORbYCFOxfM5KdnncJIXKeoUmqngrqHd4RuQHzwwqcy5Rv1vi1+wtqLH+ JcV96BMx7J6hzlxhTAghanx4XaYh14tcYx5gCncQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amir Goldstein , Miklos Szeredi Subject: [PATCH 5.11 27/31] fuse: fix live lock in fuse_iget() Date: Fri, 19 Mar 2021 13:19:21 +0100 Message-Id: <20210319121748.078936087@linuxfoundation.org> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210319121747.203523570@linuxfoundation.org> References: <20210319121747.203523570@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: 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 @@ -863,6 +863,7 @@ static inline u64 fuse_get_attr_version( static inline void fuse_make_bad(struct inode *inode) { + remove_inode_hash(inode); set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state); }