From: Boaz Harrosh <bharrosh@panasas.com>
To: Maxim Uvarov <maxim.uvarov@oracle.com>,
NFS list <linux-nfs@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] NFS/INOTIFY: inotify user when deleting files on nfs
Date: Thu, 15 Dec 2011 12:42:37 +0200 [thread overview]
Message-ID: <4EE9CF1D.6030109@panasas.com> (raw)
In-Reply-To: <1323901667-3746-1-git-send-email-maxim.uvarov@oracle.com>
Forwarding to the NFS mailing list ...
On 12/15/2011 12:27 AM, Maxim Uvarov wrote:
> This issue was introduced with LTP inotify02 test.
> If file system is not NFS user inotify application
> gets IN_DELETE event. But on NFS code avoids d_delete()
> which sends this event. This patch makes notification
> on NFS the same as non-NFS. I.e. vfs_unlink still avoids
> deletion but it sends event for NFS sillyrenamed files.
> More details here:
> https://lkml.org/lkml/2011/11/29/421
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
> ---
> fs/namei.c | 19 ++++++++++++++++---
> 1 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index a9a7166..44a997e 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -2737,10 +2737,23 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
> }
> mutex_unlock(&dentry->d_inode->i_mutex);
>
> - /* We don't d_delete() NFS sillyrenamed files--they still exist. */
> - if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) {
> +
> + if (!error) {
> fsnotify_link_count(dentry->d_inode);
> - d_delete(dentry);
> + if (!(dentry->d_flags & DCACHE_NFSFS_RENAMED))
> + d_delete(dentry);
> + else {
> + /* We don't d_delete() NFS sillyrenamed files - they
> + * still exist. But from user side this file was
> + * deleted. So that we need to generate notify event
> + * about it.
> + */
> + struct inode *inode;
> + int isdir;
> + inode = dentry->d_inode;
> + isdir = S_ISDIR(inode->i_mode);
> + fsnotify_nameremove(dentry, isdir);
> + }
> }
>
> return error;
WARNING: multiple messages have this Message-ID (diff)
From: Boaz Harrosh <bharrosh-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
To: Maxim Uvarov
<maxim.uvarov-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
NFS list <linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] NFS/INOTIFY: inotify user when deleting files on nfs
Date: Thu, 15 Dec 2011 12:42:37 +0200 [thread overview]
Message-ID: <4EE9CF1D.6030109@panasas.com> (raw)
In-Reply-To: <1323901667-3746-1-git-send-email-maxim.uvarov-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Forwarding to the NFS mailing list ...
On 12/15/2011 12:27 AM, Maxim Uvarov wrote:
> This issue was introduced with LTP inotify02 test.
> If file system is not NFS user inotify application
> gets IN_DELETE event. But on NFS code avoids d_delete()
> which sends this event. This patch makes notification
> on NFS the same as non-NFS. I.e. vfs_unlink still avoids
> deletion but it sends event for NFS sillyrenamed files.
> More details here:
> https://lkml.org/lkml/2011/11/29/421
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
> fs/namei.c | 19 ++++++++++++++++---
> 1 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index a9a7166..44a997e 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -2737,10 +2737,23 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
> }
> mutex_unlock(&dentry->d_inode->i_mutex);
>
> - /* We don't d_delete() NFS sillyrenamed files--they still exist. */
> - if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) {
> +
> + if (!error) {
> fsnotify_link_count(dentry->d_inode);
> - d_delete(dentry);
> + if (!(dentry->d_flags & DCACHE_NFSFS_RENAMED))
> + d_delete(dentry);
> + else {
> + /* We don't d_delete() NFS sillyrenamed files - they
> + * still exist. But from user side this file was
> + * deleted. So that we need to generate notify event
> + * about it.
> + */
> + struct inode *inode;
> + int isdir;
> + inode = dentry->d_inode;
> + isdir = S_ISDIR(inode->i_mode);
> + fsnotify_nameremove(dentry, isdir);
> + }
> }
>
> return error;
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-12-15 10:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 22:27 [PATCH] NFS/INOTIFY: inotify user when deleting files on nfs Maxim Uvarov
2011-12-15 10:42 ` Boaz Harrosh [this message]
2011-12-15 10:42 ` Boaz Harrosh
-- strict thread matches above, loose matches on Subject: below --
2011-12-14 22:58 Maxim Uvarov
2011-12-14 22:58 ` Maxim Uvarov
2011-12-14 23:22 ` Al Viro
2011-12-15 19:12 ` Maxim Uvarov
2011-12-15 21:32 ` Al Viro
2011-12-15 21:52 ` Myklebust, Trond
2011-12-15 22:34 ` Maxim Uvarov
2011-12-15 22:58 ` Myklebust, Trond
2011-12-15 23:27 ` Maxim Uvarov
2011-12-16 20:50 ` Stef Bon
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=4EE9CF1D.6030109@panasas.com \
--to=bharrosh@panasas.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=maxim.uvarov@oracle.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.