Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190866
b: refs/heads/master
c: e087334
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris committed May 14, 2010
1 parent e1677c8 commit 42ca74b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: 3dbc6fb6a3c8a7dc164ae330ab024a3fe65ae53e
refs/heads/master: e08733446e72b983fed850fc5d8bd21b386feb29
9 changes: 6 additions & 3 deletions trunk/fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,21 +546,24 @@ static int inotify_new_watch(struct fsnotify_group *group,
if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL)))
goto out_err;

/* we are putting the mark on the idr, take a reference */
fsnotify_get_mark(&tmp_ientry->fsn_entry);

spin_lock(&group->inotify_data.idr_lock);
ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry,
group->inotify_data.last_wd+1,
&tmp_ientry->wd);
spin_unlock(&group->inotify_data.idr_lock);
if (ret) {
/* we didn't get on the idr, drop the idr reference */
fsnotify_put_mark(&tmp_ientry->fsn_entry);

/* idr was out of memory allocate and try again */
if (ret == -EAGAIN)
goto retry;
goto out_err;
}

/* we put the mark on the idr, take a reference */
fsnotify_get_mark(&tmp_ientry->fsn_entry);

/* we are on the idr, now get on the inode */
ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode);
if (ret) {
Expand Down

0 comments on commit 42ca74b

Please sign in to comment.