(I posted this already but got no response. Am I really posting to the wrong 
list ??)

Hi, 

I have a small problem when using the directory notifications. when the 
directory itself that I watch in my program is deleted, I don't receive an 
event, although I'd expect a delete event for the "." entry (IMHO). This 
makes it much easier to detect this relatively rare case, otherwise one 
would need to add twice as many watchpoints (for every directory its parent 
directory as well), which is no good solution in my opinion. 

I append a patch. Note I have almost no idea about kernel internals and 
implicit rules about the dentry/inodes so I don't know if the thing I do is 
actually safe or if the inode can't be passed around at that point any more. 

Is this going to work ? my personal testings have not shown any 
problem, but that doesn't mean anything of course. it would be great if you 
could give me just a short note as a reply, thanks in advance. 


--- namei.c.old Fri Mar 30 22:49:57 2001
+++ namei.c     Fri Mar 30 22:54:02 2001
@@ -1423,8 +1423,11 @@
                                lock_kernel();
                                error = dir->i_op->unlink(dir, dentry);
                                unlock_kernel();
-                               if (!error)
+                               if (!error) {
+                                       if (S_ISDIR(dentry->d_inode->i_mode))
+                                               inode_dir_notify(dentry->d_inode, 
+DN_DELETE);
                                        d_delete(dentry);
+                               }
                        }
                }
        }



Dirk

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to