Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155895
b: refs/heads/master
c: 75fe2b2
h: refs/heads/master
i:
  155893: 56a926f
  155891: f9d6f51
  155887: fdb0b48
v: v3
  • Loading branch information
Eric Paris committed Jul 21, 2009
1 parent 54b2470 commit cf4905e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 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: 5549f7cdf84c02939fd368d0842aa2f472bb6e98
refs/heads/master: 75fe2b26394c59c8e16bd7b76f4be5d048103ad1
14 changes: 10 additions & 4 deletions trunk/fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,6 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
goto out_err;

spin_lock(&group->inotify_data.idr_lock);
/* if entry is added to the idr we keep the reference obtained
* through fsnotify_mark_add. remember to drop this reference
* when entry is removed from idr */
ret = idr_get_new_above(&group->inotify_data.idr, entry,
++group->inotify_data.last_wd,
&ientry->wd);
Expand All @@ -476,8 +473,13 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
goto out_err;
}
atomic_inc(&group->inotify_data.user->inotify_watches);

/* we put the mark on the idr, take a reference */
fsnotify_get_mark(entry);
}

ret = ientry->wd;

spin_lock(&entry->lock);

old_mask = entry->mask;
Expand Down Expand Up @@ -508,7 +510,11 @@ static int inotify_update_watch(struct fsnotify_group *group, struct inode *inod
fsnotify_recalc_group_mask(group);
}

return ientry->wd;
/* this either matches fsnotify_find_mark_entry, or init_mark_entry
* depending on which path we took... */
fsnotify_put_mark(entry);

return ret;

out_err:
/* see this isn't supposed to happen, just kill the watch */
Expand Down

0 comments on commit cf4905e

Please sign in to comment.