Bugzilla – Attachment 60580 Details for
Bug 131322
inotify support broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Inotify fixes for 2.6.13
inotify-update-rml-2.6.13-1.patch (text/plain), 3.53 KB, created by
Robert Love
on 2005-12-14 20:22:11 UTC
(
hide
)
Description:
Inotify fixes for 2.6.13
Filename:
MIME Type:
Creator:
Robert Love
Created:
2005-12-14 20:22:11 UTC
Size:
3.53 KB
patch
obsolete
> >Inotify updates. > > fs/dcache.c | 3 ++- > fs/inotify.c | 19 +++++++++++++++++-- > fs/xattr.c | 2 ++ > include/linux/inotify.h | 1 + > 4 files changed, 22 insertions(+), 3 deletions(-) > >--- linux-2.6.13/fs/dcache.c 2005-08-28 19:41:01.000000000 -0400 >+++ linux-2.6.15-rc5/fs/dcache.c 2005-12-14 14:58:07.000000000 -0500 >@@ -102,7 +102,8 @@ > list_del_init(&dentry->d_alias); > spin_unlock(&dentry->d_lock); > spin_unlock(&dcache_lock); >- fsnotify_inoderemove(inode); >+ if (!inode->i_nlink) >+ fsnotify_inoderemove(inode); > if (dentry->d_op && dentry->d_op->d_iput) > dentry->d_op->d_iput(dentry, inode); > else >--- linux-2.6.13/fs/inotify.c 2005-08-28 19:41:01.000000000 -0400 >+++ linux-2.6.15-rc5/fs/inotify.c 2005-12-14 14:58:08.000000000 -0500 >@@ -37,6 +37,7 @@ > #include <asm/ioctls.h> > > static atomic_t inotify_cookie; >+static atomic_t inotify_watches; > > static kmem_cache_t *watch_cachep; > static kmem_cache_t *event_cachep; >@@ -175,6 +176,7 @@ > if (atomic_dec_and_test(&dev->count)) { > atomic_dec(&dev->user->inotify_devs); > free_uid(dev->user); >+ idr_destroy(&dev->idr); > kfree(dev); > } > } >@@ -370,7 +372,7 @@ > if (error) > return error; > /* you can only watch an inode if you have read permissions on it */ >- error = permission(nd->dentry->d_inode, MAY_READ, NULL); >+ error = vfs_permission(nd, MAY_READ); > if (error) > path_release(nd); > return error; >@@ -422,6 +424,7 @@ > get_inotify_watch(watch); > > atomic_inc(&dev->user->inotify_watches); >+ atomic_inc(&inotify_watches); > > return watch; > } >@@ -454,6 +457,7 @@ > list_del(&watch->d_list); > > atomic_dec(&dev->user->inotify_watches); >+ atomic_dec(&inotify_watches); > idr_remove(&dev->idr, watch->wd); > put_inotify_watch(watch); > } >@@ -532,6 +536,9 @@ > struct dentry *parent; > struct inode *inode; > >+ if (!atomic_read (&inotify_watches)) >+ return; >+ > spin_lock(&dentry->d_lock); > parent = dentry->d_parent; > inode = parent->d_inode; >@@ -925,6 +932,7 @@ > struct nameidata nd; > struct file *filp; > int ret, fput_needed; >+ int mask_add = 0; > > filp = fget_light(fd, &fput_needed); > if (unlikely(!filp)) >@@ -947,6 +955,9 @@ > down(&inode->inotify_sem); > down(&dev->sem); > >+ if (mask & IN_MASK_ADD) >+ mask_add = 1; >+ > /* don't let user-space set invalid bits: we don't want flags set */ > mask &= IN_ALL_EVENTS; > if (unlikely(!mask)) { >@@ -960,7 +971,10 @@ > */ > old = inode_find_dev(inode, dev); > if (unlikely(old)) { >- old->mask = mask; >+ if (mask_add) >+ old->mask |= mask; >+ else >+ old->mask = mask; > ret = old->wd; > goto out; > } >@@ -1043,6 +1057,7 @@ > inotify_max_user_watches = 8192; > > atomic_set(&inotify_cookie, 0); >+ atomic_set(&inotify_watches, 0); > > watch_cachep = kmem_cache_create("inotify_watch_cache", > sizeof(struct inotify_watch), >--- linux-2.6.13/fs/xattr.c 2005-08-28 19:41:01.000000000 -0400 >+++ linux-2.6.15-rc5/fs/xattr.c 2005-12-14 14:58:09.000000000 -0500 >@@ -307,6 +326,8 @@ > down(&d->d_inode->i_sem); > error = d->d_inode->i_op->removexattr(d, kname); > up(&d->d_inode->i_sem); >+ if (!error) >+ fsnotify_xattr(d); > } > out: > return error; >--- linux-2.6.13/include/linux/inotify.h 2005-08-28 19:41:01.000000000 -0400 >+++ linux-2.6.15-rc5/include/linux/inotify.h 2005-10-27 20:02:08.000000000 -0400 >@@ -47,6 +47,7 @@ > #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ > > /* special flags */ >+#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ > #define IN_ISDIR 0x40000000 /* event occurred against dir */ > #define IN_ONESHOT 0x80000000 /* only send event once */ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 131322
:
55935
|
56009
|
60580
|
61968