Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207618
b: refs/heads/master
c: 7050c48
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent 29e9994 commit 4ca971a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: 6f3a539e3bd8ed2eafa532443723d56896153a00
refs/heads/master: 7050c48826d5adb2210bddfb6a67aa13bbe984ed
13 changes: 6 additions & 7 deletions trunk/fs/notify/inotify/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static int inotify_find_inode(const char __user *dirname, struct path *path, uns
}

static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock,
int last_wd,
int *last_wd,
struct inotify_inode_mark_entry *ientry)
{
int ret;
Expand All @@ -368,11 +368,13 @@ static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock,
return -ENOMEM;

spin_lock(idr_lock);
ret = idr_get_new_above(idr, ientry, last_wd + 1,
ret = idr_get_new_above(idr, ientry, *last_wd + 1,
&ientry->wd);
/* we added the mark to the idr, take a reference */
if (!ret)
if (!ret) {
fsnotify_get_mark(&ientry->fsn_entry);
*last_wd = ientry->wd;
}
spin_unlock(idr_lock);
} while (ret == -EAGAIN);

Expand Down Expand Up @@ -647,7 +649,7 @@ static int inotify_new_watch(struct fsnotify_group *group,
if (atomic_read(&group->inotify_data.user->inotify_watches) >= inotify_max_user_watches)
goto out_err;

ret = inotify_add_to_idr(idr, idr_lock, group->inotify_data.last_wd,
ret = inotify_add_to_idr(idr, idr_lock, &group->inotify_data.last_wd,
tmp_ientry);
if (ret)
goto out_err;
Expand All @@ -660,9 +662,6 @@ static int inotify_new_watch(struct fsnotify_group *group,
goto out_err;
}

/* update the idr hint, who cares about races, it's just a hint */
group->inotify_data.last_wd = tmp_ientry->wd;

/* increment the number of watches the user has */
atomic_inc(&group->inotify_data.user->inotify_watches);

Expand Down

0 comments on commit 4ca971a

Please sign in to comment.