Re: [PATCH v3] fsnotify: rework unlink/rmdir notify events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/17/21 10:48 AM, Jan Kara wrote:
Hi!

Thanks for the patch but I think you missed Amir's comments to your v2 [1]?
Also ...


I think they came in after I sent v3, but I got mailinglist signup spammed last week, so needless to say my ability to deal with emails for the last week has been hampered a bit. I'm going through his review and will send out v4 today/tomorrow.

diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 42e5a766d33c..714e6f9b74f5 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -617,12 +617,17 @@ void *devpts_get_priv(struct dentry *dentry)
   */
  void devpts_pty_kill(struct dentry *dentry)
  {
+	struct inode *dir = d_inode(dentry->d_parent);
+	struct inode *inode = d_inode(dentry);
+
  	WARN_ON_ONCE(dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC);
+ ihold(inode);
  	dentry->d_fsdata = NULL;
  	drop_nlink(dentry->d_inode);
-	fsnotify_unlink(d_inode(dentry->d_parent), dentry);
  	d_drop(dentry);
+	fsnotify_delete(dir, dentry, inode);
+	iput(inode);
  	dput(dentry);	/* d_alloc_name() in devpts_pty_new() */
  }

AFAICT d_drop() actually doesn't make the dentry negative so there's no
need for this inode reference game? And similarly for d_invalidate() below?
Or am I missing something?


Nope you're right, I had it in my head that ___d_drop would do the dentry_unlink_inode, but it doesn't, I'll fix this, thanks,

Josef



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux