Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp11930imn; Fri, 1 Jul 2022 08:54:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tmu/wMUA70+Cx6blln5JA/rOIAvRycmQxs+7PZsbyJMSHYZMdEpsisZ/uFbQHnChHBn1bh X-Received: by 2002:a05:6402:d0a:b0:437:66ca:c211 with SMTP id eb10-20020a0564020d0a00b0043766cac211mr20096120edb.29.1656690853481; Fri, 01 Jul 2022 08:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656690853; cv=none; d=google.com; s=arc-20160816; b=jV78taGCVlbtYDTnH91nQNDhBnyqZoEC/xsyZoVSbfotF3okxQzsVqydKwwF1oM1SR HQZDBkNQkFrWAobiA0QHH33CR7vYgNRAKnTaaAcGSr8G1Px92vE+yGN6ECA7W6jFr2HS vsxNeNp+H5A/Q2OHBzoLvraokJOZRzlMfzmN95QNbGmDbFXGoKBX49YODzsoI+4qFV6f wIrXyyHZj1xPHpMDXJggq/8KeNfOZftudme8tsTJt6Fl1+M6wFdaMNpPC8hbeD29ECoX VD3d4/X4/PmTA3CaXjC3cvSqD1pYSNp9j6kjRRl9MLjG44AGdRyRQ89DUUM10oghwtOt yABg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sr/mG9q9+C4tJJCgESqtyeVDTRbtxwKAhmfnIpmQCdM=; b=PkOFU3YApvWOWWobr2p3EaxaSNWt+50AKcpk7zt2r8JCGMNBFx+3d9HO2fPx/Zg1DU 1ECUkPl9ZpweuzGt8RenrsyvR6f34uOWbkqnWJa5AAV4TH3ridgg4w0Afu44UfxBmcGo FDXO4JX+E1poYz2Zry0R/yUHeGgokC99t/swti4I3CUaYUs/fZav7PHbtJzDs7zwYxzN VS4ghLuRB6B9kgMQhNEhAzlx4Y4OZB38RUsgMgNxfyJFDlYdjSP/TXStIXKr0GVZpBje hA44n5xdNimcVTqPP00T/S588d6LygSaUJuskioekkG68BQSKbXTrQPcRoIQ+99BKMlr S9KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SPls6Voq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a05640212c700b0042dc488f221si10674342edx.57.2022.07.01.08.53.48; Fri, 01 Jul 2022 08:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SPls6Voq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232000AbiGAPeR (ORCPT + 99 others); Fri, 1 Jul 2022 11:34:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231146AbiGAPeP (ORCPT ); Fri, 1 Jul 2022 11:34:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 196242180E; Fri, 1 Jul 2022 08:34:15 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id DB70EB83095; Fri, 1 Jul 2022 15:34:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5C7BC3411E; Fri, 1 Jul 2022 15:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656689652; bh=CI4g7mpBhd83x+K5yI20gm0estbqkbyjJjCXm+Yhu0k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SPls6VoqkTe+RubK8D8fXPO4NUYKPt5wX3G/tlfPGXjf7XuSbbG0POKLgZC0D12+7 qxqdFk7UVV0mtlJ0lgX7a6YkTUm/xFVUxLV4nKXtgKQT1zTGGBy1FcmwtmH53fwuE9 fyasv9Z9IAbVw7gTk5VBIUT/5c26+VnDVZZ0oLfmhXu/r+nQjU02YwBVdsmP2SJPJb +KDMPtSSnNCLg8abbskoEQ16enu38jgM/pdIczLYuwtC9tq1oiWApdaCR+K1IrNQNH oB6NDaNvvVyJWldDZFhQoqThW/UxBR+dCbhWWnRE6Jq19ngUa3HHxV1+2Pt/4hH5rH 3v0ToJAifcDsA== Date: Fri, 1 Jul 2022 08:34:10 -0700 From: Nathan Chancellor To: Imran Khan Cc: tj@kernel.org, gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk, m.szyprowski@samsung.com, michael@walle.cc, robh@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, guillaume.tucker@collabora.com, pmladek@suse.com Subject: Re: [PATCH] kernfs: Avoid re-adding kernfs_node into kernfs_notify_list. Message-ID: References: <20220701145047.2206900-1-imran.f.khan@oracle.com> <2c4bdc7a-b49f-c2ea-28d0-4ec838c3b26c@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c4bdc7a-b49f-c2ea-28d0-4ec838c3b26c@oracle.com> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 02, 2022 at 01:18:09AM +1000, Imran Khan wrote: > Hello Nathan, > > On 2/7/22 1:10 am, Nathan Chancellor wrote: > > On Sat, Jul 02, 2022 at 12:50:47AM +1000, Imran Khan wrote: > >> Kick fsnotify only if an event is not already scheduled for target > >> kernfs node. commit b8f35fa1188b ("kernfs: Change kernfs_notify_list to > >> llist.") changed kernfs_notify_list to a llist. > >> Prior to this list was a singly linked list, protected by > >> kernfs_notify_lock. Whenever a kernfs_node was added to the list > >> its ->attr.notify_next was set to head of the list and upon removal > >> ->attr.notify_next was reset to NULL. Addition to kernfs_notify_list > >> would only happen if kernfs_node was not already in the list i.e. > >> if ->attr.notify_next was NULL. commit b8f35fa1188b ("kernfs: Change > >> kernfs_notify_list to llist.") removed this checking and this was wrong > >> as it resulted in multiple additions for same kernfs_node. > >> > >> So far this bug only got reflected with some console related setting. > >> Nathan found this issue when console was specified both in DT and in > >> kernel command line and Marek found this issue when earlycon was enabled. > >> > >> This patch avoids adding an already added kernfs_node into notify list. > >> > >> Reported-by: Nathan Chancellor > >> Reported-by: Marek Szyprowski > > > > This should also include: > > > > Reported-by: Michael Walle > > > >> Tested-by: Marek Szyprowski > >> Fixes: b8f35fa1188b ("kernfs: Change kernfs_notify_list to llist.") > >> Signed-off-by: Imran Khan > > > > For the ARCH=um case that I noticed: > > > > Tested-by: Nathan Chancellor > > > > I am really sorry about missing these tags. I was not sure if you have tested > the patch I sent this morning. No worries, we all forget tags :) I hadn't tested your patch until this point so there was no reason for you to add that tag, this was the first time I provided it so there is no problem there. Thanks for the quick fix! Cheers, Nathan