Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347898
b: refs/heads/master
c: 6dfbd14
h: refs/heads/master
v: v3
  • Loading branch information
Lino Sanfilippo authored and Eric Paris committed Dec 11, 2012
1 parent bee933b commit cc61a07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 104d06f08ea59247cb0e7e548c5a5d22d21dcfd5
refs/heads/master: 6dfbd149946c22c2e2886d6b560def78630c8387
19 changes: 14 additions & 5 deletions trunk/fs/notify/fanotify/fanotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@ static int fanotify_find_path(int dfd, const char __user *filename,

static __u32 fanotify_mark_remove_from_mask(struct fsnotify_mark *fsn_mark,
__u32 mask,
unsigned int flags)
unsigned int flags,
int *destroy)
{
__u32 oldmask;

Expand All @@ -525,8 +526,7 @@ static __u32 fanotify_mark_remove_from_mask(struct fsnotify_mark *fsn_mark,
}
spin_unlock(&fsn_mark->lock);

if (!(oldmask & ~mask))
fsnotify_destroy_mark(fsn_mark);
*destroy = !(oldmask & ~mask);

return mask & oldmask;
}
Expand All @@ -537,12 +537,17 @@ static int fanotify_remove_vfsmount_mark(struct fsnotify_group *group,
{
struct fsnotify_mark *fsn_mark = NULL;
__u32 removed;
int destroy_mark;

fsn_mark = fsnotify_find_vfsmount_mark(group, mnt);
if (!fsn_mark)
return -ENOENT;

removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags);
removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags,
&destroy_mark);
if (destroy_mark)
fsnotify_destroy_mark(fsn_mark);

fsnotify_put_mark(fsn_mark);
if (removed & real_mount(mnt)->mnt_fsnotify_mask)
fsnotify_recalc_vfsmount_mask(mnt);
Expand All @@ -556,12 +561,16 @@ static int fanotify_remove_inode_mark(struct fsnotify_group *group,
{
struct fsnotify_mark *fsn_mark = NULL;
__u32 removed;
int destroy_mark;

fsn_mark = fsnotify_find_inode_mark(group, inode);
if (!fsn_mark)
return -ENOENT;

removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags);
removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags,
&destroy_mark);
if (destroy_mark)
fsnotify_destroy_mark(fsn_mark);
/* matches the fsnotify_find_inode_mark() */
fsnotify_put_mark(fsn_mark);
if (removed & inode->i_fsnotify_mask)
Expand Down

0 comments on commit cc61a07

Please sign in to comment.