All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiaoming Ni <nixiaoming@huawei.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<wangle6@huawei.com>
Subject: Re: Question: Why is there no notification when a file is opened using filp_open()?
Date: Tue, 8 Sep 2020 20:53:07 +0800	[thread overview]
Message-ID: <e399cd17-e95e-def4-e03b-5cc2ae1f9708@huawei.com> (raw)
In-Reply-To: <CAOQ4uxhejJzjKLZCt=b87KAX0sC3RAZ2FHEZbu4188Ar-bkmOg@mail.gmail.com>

On 2020/9/8 18:06, Amir Goldstein wrote:
> On Tue, Sep 8, 2020 at 11:02 AM Xiaoming Ni <nixiaoming@huawei.com> wrote:
>>
>> The file opening action on the system may be from user-mode sys_open()
>> or kernel-mode filp_open().
>> Currently, fsnotify_open() is invoked in do_sys_openat2().
>> But filp_open() is not notified. Why? Is this an omission?
>>
>> Do we need to call fsnotify_open() in filp_open() or  do_filp_open() to
>> ensure that both user-mode and kernel-mode file opening operations can
>> be notified?
>>
> 
> Do you have a specific use case of kernel filp_open() in mind?
> 

For example, in fs/coredump.c, do_coredump() calls filp_open() to 
generate core files.
In this scenario, the fsnotify_open() notification is missing.

Thanks
Xiaoming Ni


  reply	other threads:[~2020-09-08 17:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  8:01 Question: Why is there no notification when a file is opened using filp_open()? Xiaoming Ni
2020-09-08 10:06 ` Amir Goldstein
2020-09-08 12:53   ` Xiaoming Ni [this message]
2020-09-08 13:18     ` Amir Goldstein
2020-09-08 17:18       ` Matthew Wilcox
2020-09-09  3:44         ` Amir Goldstein
2020-09-09  6:59           ` Xiaoming Ni
2020-09-09  7:36             ` Amir Goldstein
2020-09-09 11:11               ` Jan Kara
2020-09-09 16:03                 ` Amir Goldstein
2020-09-10  8:14                   ` Jan Kara

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=e399cd17-e95e-def4-e03b-5cc2ae1f9708@huawei.com \
    --to=nixiaoming@huawei.com \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangle6@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.