Skip to content

Conversation

@royzhong7070
Copy link

No description provided.

arp242 added a commit that referenced this pull request Mar 31, 2025
inotify_add_watch() follows symlinks, and returns the current watch
descriptor when adding a patch twice. So when doing "watch dir" and
"watch link" (or reverse) second watch is basically a no-op; yet it's
still registered as a "separate" watch, and would panic on removing the
second.

The solution is to make the second Add() a no-op. This is also what
kqueue does, and what happens if you watch the same path twice.

On illumos watching a symlink currently means registering double
watches; this is a separate bug that should be fixed.

Fixes #652
Fixes #662
arp242 added a commit that referenced this pull request Mar 31, 2025
inotify_add_watch() follows symlinks, and returns the current watch
descriptor when adding a patch twice. So when doing "watch dir" and
"watch link" (or reverse) second watch is basically a no-op; yet it's
still registered as a "separate" watch, and would panic on removing the
second.

The solution is to make the second Add() a no-op. This is also what
kqueue does, and what happens if you watch the same path twice.

On illumos watching a symlink currently means registering double
watches; this is a separate bug that should be fixed.

Fixes #652
Fixes #662
arp242 added a commit that referenced this pull request Mar 31, 2025
inotify_add_watch() follows symlinks, and returns the current watch
descriptor when adding a patch twice. So when doing "watch dir" and
"watch link" (or reverse) second watch is basically a no-op; yet it's
still registered as a "separate" watch, and would panic on removing the
second.

The solution is to make the second Add() a no-op. This is also what
kqueue does, and what happens if you watch the same path twice.

On illumos watching a symlink currently means registering double
watches; this is a separate bug that should be fixed.

Fixes #652
Fixes #662
arp242 added a commit that referenced this pull request Mar 31, 2025
inotify_add_watch() follows symlinks, and returns the current watch
descriptor when adding a patch twice. So when doing "watch dir" and
"watch link" (or reverse) second watch is basically a no-op; yet it's
still registered as a "separate" watch, and would panic on removing the
second.

The solution is to make the second Add() a no-op. This is also what
kqueue does, and what happens if you watch the same path twice.

On illumos watching a symlink currently means registering double
watches; this is a separate bug that should be fixed.

Fixes #652
Fixes #662
@arp242 arp242 closed this in #679 Mar 31, 2025
@arp242 arp242 closed this in 520d098 Mar 31, 2025
jakubno pushed a commit to e2b-dev/fsnotify that referenced this pull request Jul 31, 2025
inotify_add_watch() follows symlinks, and returns the current watch
descriptor when adding a patch twice. So when doing "watch dir" and
"watch link" (or reverse) second watch is basically a no-op; yet it's
still registered as a "separate" watch, and would panic on removing the
second.

The solution is to make the second Add() a no-op. This is also what
kqueue does, and what happens if you watch the same path twice.

On illumos watching a symlink currently means registering double
watches; this is a separate bug that should be fixed.

Fixes fsnotify#652
Fixes fsnotify#662
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant