diff options
author | John McCutchan <ttb@tentacle.dhs.org> | 2005-08-26 14:02:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-26 11:32:57 -0700 |
commit | 7c657f2f25d50c602df9291bc6242b98fc090759 (patch) | |
tree | 5e1ae11c320ea00488b33224cc982d0be2d986d6 /fs/inotify.c | |
parent | 755528c860b05fcecda1c88a2bdaffcb50760a7f (diff) | |
download | op-kernel-dev-7c657f2f25d50c602df9291bc6242b98fc090759.zip op-kernel-dev-7c657f2f25d50c602df9291bc6242b98fc090759.tar.gz |
[PATCH] Document idr_get_new_above() semantics, update inotify
There is an off by one problem with idr_get_new_above.
The comment and function name suggest that it will return an id >
starting_id, but it actually returned an id >= starting_id, and kernel
callers other than inotify treated it as such.
The patch below fixes the comment, and fixes inotifys usage. The
function name still doesn't match the behaviour, but it never did.
Signed-off-by: John McCutchan <ttb@tentacle.dhs.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/inotify.c')
-rw-r--r-- | fs/inotify.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/inotify.c b/fs/inotify.c index 868901b..2e4e2a5 100644 --- a/fs/inotify.c +++ b/fs/inotify.c @@ -353,7 +353,7 @@ static int inotify_dev_get_wd(struct inotify_device *dev, do { if (unlikely(!idr_pre_get(&dev->idr, GFP_KERNEL))) return -ENOSPC; - ret = idr_get_new_above(&dev->idr, watch, dev->last_wd, &watch->wd); + ret = idr_get_new_above(&dev->idr, watch, dev->last_wd+1, &watch->wd); } while (ret == -EAGAIN); return ret; |