diff options
Diffstat (limited to 'fs/inotify.c')
-rw-r--r-- | fs/inotify.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/inotify.c b/fs/inotify.c index 27ebcac5e07f..2e4e2a57708c 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -353,7 +353,7 @@ static int inotify_dev_get_wd(struct inotify_device *dev, | |||
353 | do { | 353 | do { |
354 | if (unlikely(!idr_pre_get(&dev->idr, GFP_KERNEL))) | 354 | if (unlikely(!idr_pre_get(&dev->idr, GFP_KERNEL))) |
355 | return -ENOSPC; | 355 | return -ENOSPC; |
356 | ret = idr_get_new_above(&dev->idr, watch, dev->last_wd, &watch->wd); | 356 | ret = idr_get_new_above(&dev->idr, watch, dev->last_wd+1, &watch->wd); |
357 | } while (ret == -EAGAIN); | 357 | } while (ret == -EAGAIN); |
358 | 358 | ||
359 | return ret; | 359 | return ret; |
@@ -402,7 +402,7 @@ static struct inotify_watch *create_watch(struct inotify_device *dev, | |||
402 | return ERR_PTR(ret); | 402 | return ERR_PTR(ret); |
403 | } | 403 | } |
404 | 404 | ||
405 | dev->last_wd = ret; | 405 | dev->last_wd = watch->wd; |
406 | watch->mask = mask; | 406 | watch->mask = mask; |
407 | atomic_set(&watch->count, 0); | 407 | atomic_set(&watch->count, 0); |
408 | INIT_LIST_HEAD(&watch->d_list); | 408 | INIT_LIST_HEAD(&watch->d_list); |