mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: linux-fsdevel@vger.kernel.org,
	Aihua Zhang <zhangaihua1@huawei.com>,
	linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Jan Kara <jack@suse.cz>, Eric Paris <eparis@redhat.com>
Subject: Re: [PATCH 04/12] fsnotify: support overlayfs
Date: Fri, 16 Sep 2016 18:38:07 +0200	[thread overview]
Message-ID: <20160916163807.GD2433@quack2.suse.cz> (raw)
In-Reply-To: <1474028371-21288-5-git-send-email-mszeredi@redhat.com>

On Fri 16-09-16 14:19:23, Miklos Szeredi wrote:
> From: Aihua Zhang <zhangaihua1@huawei.com>
> 
> When an event occurs direct it to the overlay inode instead of the real
> underlying inode.
> 
> This will work even if the file was first on the lower layer and then
> copied up, while the watch is there.  This is because the watch is on the
> overlay inode, which stays the same through the copy-up.
> 
> For filesystems other than overlayfs this is a no-op, except for the
> performance impact of an extra pointer dereferece.
> 
> Verified to work correctly with the inotify/fanotify tests in LTP.
> 
> Signed-off-by: Aihua Zhang <zhangaihua1@huawei.com>
> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Eric Paris <eparis@redhat.com>
> ---
>  include/linux/fsnotify.h | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
> index eed9e853a06f..b8bcc058e031 100644
> --- a/include/linux/fsnotify.h
> +++ b/include/linux/fsnotify.h
> @@ -29,7 +29,11 @@ static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u3
>  static inline int fsnotify_perm(struct file *file, int mask)
>  {
>  	struct path *path = &file->f_path;
> -	struct inode *inode = file_inode(file);
> +	/*
> +	 * Do not use file_inode() here or anywhere in this file to get the
> +	 * inode.  That would break *notity on overlayfs.
> +	 */
> +	struct inode *inode = path->dentry->d_inode;

So shouldn't we rather have d_backing_inode(path->dentry) here and
everywhere else?

									Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2016-09-16 19:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 12:19 [PATCH 00/12] misc filesystem patches for 4.9 Miklos Szeredi
2016-09-16 12:19 ` [PATCH 01/12] ima: use file_dentry() Miklos Szeredi
2016-09-16 12:19 ` [PATCH 02/12] vfs: move permission checking into notify_change() for utimes(NULL) Miklos Szeredi
2016-09-16 12:19 ` [PATCH 03/12] vfs: update ovl inode before relatime check Miklos Szeredi
2016-09-16 12:19 ` [PATCH 04/12] fsnotify: support overlayfs Miklos Szeredi
2016-09-16 16:38   ` Jan Kara [this message]
2016-09-17  6:20     ` Amir Goldstein
2016-09-16 12:19 ` [PATCH 05/12] locks: fix file locking on overlayfs Miklos Szeredi
2016-09-16 12:19 ` [PATCH 06/12] vfs: make argument of d_real_inode() const Miklos Szeredi
2016-09-16 12:19 ` [PATCH 07/12] vfs: do get_write_access() on upper layer of overlayfs Miklos Szeredi
2016-09-16 12:19 ` [PATCH 08/12] btrfs: use filemap_check_errors() Miklos Szeredi
2016-09-16 12:19 ` [PATCH 09/12] f2fs: " Miklos Szeredi
2016-09-16 12:19 ` [PATCH 10/12] posix_acl: don't ignore return value of posix_acl_create_masq() Miklos Szeredi
2016-09-16 12:45   ` Andreas Grünbacher
2016-09-16 12:19 ` [PATCH 11/12] cifs: don't use ->d_time Miklos Szeredi
2016-09-16 12:19 ` [PATCH 12/12] vfat: " Miklos Szeredi

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=20160916163807.GD2433@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=eparis@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zhangaihua1@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®