Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1376601imi; Fri, 1 Jul 2022 08:31:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v+jthgQUTYpXs62xXub/OY+Dsbn1jqcK2D2zM8T7EQ83UDQ/wc0ST4GcrLu6eB7JTrvr/n X-Received: by 2002:a17:907:6ea0:b0:726:efd4:9e29 with SMTP id sh32-20020a1709076ea000b00726efd49e29mr14793258ejc.350.1656689503278; Fri, 01 Jul 2022 08:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656689503; cv=none; d=google.com; s=arc-20160816; b=p5TjEHm3lOFdYb/Dkya26F5w3gpJ+HXFbBCDWRT8pWTXQ4xBHITx2cczMPxd7DOp/K UxZKTYitMyZ7Fle3iwz99keD/VfGQbUGM61B2QtGcEU//yGx+AvmRqrvqUGPXuaP7574 L2Mf8s3+BQwn/REv8222r6UdOFqstG3ikfjj53Cc800CzkRXPFz26C5Avu6IrOOeYbXH gpi5arQ6D9VH6quqlkV0p+T+qjKhsYVanepvd+zTuNPuNbFqSr5si6Plc6n1g8YX4qet up2BlNsrMwk3dkx9mlTPebzci8ErE+ciMyseiRSLoEGprE26CfBiz2OQoxSZGLzraZ2D 3YRA== 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=ci11bE+aLZUSWsbKubPRXHVJbeKjl/9kdgBca0UuPh8=; b=Xbp8pegkgcoPyk5Zjm2sSuRmc+1fRlJSGLba+uKcpqBd4n/lN3LEaVfEYsaMSqO06f EYjGvYjT1fMbfb0GRzZ6VkPDlVdpNCjcKwnGDG4JuFY2TpB82u/sp5WOm3xKNaaqDoc0 RA5vhM6H97eThx27rMRZrPYdGMaxG+GGEt3X3p0vBdAy5caTeWEGKNIJQo/aSuwaxhOU H0iUYN4fzjloqQsexNlK07zbTg+fKsqKPUU+FKVafEUIjsJAtYsLF4+VEQWw2RyjY4LU x234hkF6g2GVhNfZi4lckGqOzlcSJ/uHeyKEG0LzhuPLN+y6f5ghWXt7QrjfF9Wli8Xg 4Ehg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HAGfJ701; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rk9-20020a170907214900b00722f4502e2csi25114341ejb.631.2022.07.01.08.31.17; Fri, 01 Jul 2022 08:31:43 -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=@linuxfoundation.org header.s=korg header.b=HAGfJ701; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231510AbiGAP3M (ORCPT + 99 others); Fri, 1 Jul 2022 11:29:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiGAP3H (ORCPT ); Fri, 1 Jul 2022 11:29:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1E9F1F60D; Fri, 1 Jul 2022 08:29:06 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 39BC862414; Fri, 1 Jul 2022 15:29:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C587C3411E; Fri, 1 Jul 2022 15:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656689345; bh=fg4rHu8CbbqFBxKzijEGmEDBRGujBS5oSTYCqS8ZW70=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HAGfJ701w0/wjeuqllH40r3iH05v/wKY7zEntWAJRSpPcG+9b8Q5miparWa6qm556 TnxIN4cuwNhjSmg+XwnEpBYcwuiOQrZgAZjVIW+Q8dBMkrlQYB88kM6c7LhbmiQIdc 0H0ZecFc5lF9ne4ISpiVbZPBhY7xCyZpJYnGSdh8= Date: Fri, 1 Jul 2022 17:29:02 +0200 From: Greg KH To: Imran Khan Cc: Nathan Chancellor , tj@kernel.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. > > Could you please suggest me if I should send a v2 of this change with these tags > included or if this mail is enough. Sorry if I am asking something obvious but I > am encountering such situation for first time. Please resend with them added. thanks, greg k-h