Commit f7be7284 authored by Jeff Layton's avatar Jeff Layton Committed by Trond Myklebust

nfs: emit a fsnotify_nameremove call in sillyrename codepath

If a file is sillyrenamed, then the generic vfs_unlink code will skip
emitting fsnotify events for it.

This patch has the sillyrename code do that instead.

In truth this is a little bit odd since we aren't actually removing the
dentry per-se, but renaming it. Still, this is probably the right thing
to do since it's what userland apps expect to see when an unlink()
occurs or some file is renamed on top of the dentry.
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Tested-by: default avatarAnna Schumaker <Anna.Schumaker@netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 33912be8
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/namei.h> #include <linux/namei.h>
#include <linux/fsnotify.h>
#include "internal.h" #include "internal.h"
#include "nfs4_fs.h" #include "nfs4_fs.h"
...@@ -465,8 +466,18 @@ nfs_async_rename(struct inode *old_dir, struct inode *new_dir, ...@@ -465,8 +466,18 @@ nfs_async_rename(struct inode *old_dir, struct inode *new_dir,
static void static void
nfs_complete_sillyrename(struct rpc_task *task, struct nfs_renamedata *data) nfs_complete_sillyrename(struct rpc_task *task, struct nfs_renamedata *data)
{ {
if (task->tk_status != 0) struct dentry *dentry = data->old_dentry;
nfs_cancel_async_unlink(data->old_dentry);
if (task->tk_status != 0) {
nfs_cancel_async_unlink(dentry);
return;
}
/*
* vfs_unlink and the like do not issue this when a file is
* sillyrenamed, so do it here.
*/
fsnotify_nameremove(dentry, 0);
} }
#define SILLYNAME_PREFIX ".nfs" #define SILLYNAME_PREFIX ".nfs"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment