linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Imran Khan <imran.f.khan@oracle.com>
To: Nathan Chancellor <nathan@kernel.org>
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.
Date: Sat, 2 Jul 2022 01:18:09 +1000	[thread overview]
Message-ID: <2c4bdc7a-b49f-c2ea-28d0-4ec838c3b26c@oracle.com> (raw)
In-Reply-To: <Yr8OSxotW2VEUyKQ@dev-arch.thelio-3990X>

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 <nathan@kernel.org>
>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> 
> This should also include:
> 
> Reported-by: Michael Walle <michael@walle.cc>
> 
>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Fixes: b8f35fa1188b ("kernfs: Change kernfs_notify_list to llist.")
>> Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
> 
> For the ARCH=um case that I noticed:
> 
> Tested-by: Nathan Chancellor <nathan@kernel.org>
> 

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.

Thanks
-- Imran

  reply	other threads:[~2022-07-01 15:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 14:50 [PATCH] kernfs: Avoid re-adding kernfs_node into kernfs_notify_list Imran Khan
2022-07-01 15:10 ` Nathan Chancellor
2022-07-01 15:18   ` Imran Khan [this message]
2022-07-01 15:29     ` Greg KH
2022-07-01 15:34     ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c4bdc7a-b49f-c2ea-28d0-4ec838c3b26c@oracle.com \
    --to=imran.f.khan@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guillaume.tucker@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=michael@walle.cc \
    --cc=nathan@kernel.org \
    --cc=pmladek@suse.com \
    --cc=robh@kernel.org \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).