diff mbox series

[v3,07/10] debugfs: call fsnotify_{unlink,rmdir}() hooks

Message ID 20190526143411.11244-8-amir73il@gmail.com
State New, archived
Headers show
Series Sort out fsnotify_nameremove() mess | expand

Commit Message

Amir Goldstein May 26, 2019, 2:34 p.m. UTC
This will allow generating fsnotify delete events after the
fsnotify_nameremove() hook is removed from d_delete().

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 fs/debugfs/inode.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Greg Kroah-Hartman June 3, 2019, 1:31 p.m. UTC | #1
On Sun, May 26, 2019 at 05:34:08PM +0300, Amir Goldstein wrote:
> This will allow generating fsnotify delete events after the
> fsnotify_nameremove() hook is removed from d_delete().
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>  fs/debugfs/inode.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
> index d89874da9791..1e444fe1f778 100644
> --- a/fs/debugfs/inode.c
> +++ b/fs/debugfs/inode.c
> @@ -643,8 +643,11 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
>  		dget(dentry);
>  		if (d_is_dir(dentry)) {
>  			ret = simple_rmdir(d_inode(parent), dentry);
> +			if (!ret)
> +				fsnotify_rmdir(d_inode(parent), dentry);
>  		} else {
>  			simple_unlink(d_inode(parent), dentry);
> +			fsnotify_unlink(d_inode(parent), dentry);
>  		}
>  		if (!ret)
>  			d_delete(dentry);
> -- 
> 2.17.1

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff mbox series

Patch

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index d89874da9791..1e444fe1f778 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -643,8 +643,11 @@  static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
 		dget(dentry);
 		if (d_is_dir(dentry)) {
 			ret = simple_rmdir(d_inode(parent), dentry);
+			if (!ret)
+				fsnotify_rmdir(d_inode(parent), dentry);
 		} else {
 			simple_unlink(d_inode(parent), dentry);
+			fsnotify_unlink(d_inode(parent), dentry);
 		}
 		if (!ret)
 			d_delete(dentry);