Skip to content

inotify: don't remove sibling watches sharing a path prefix#754

Merged
mattn merged 1 commit into
fsnotify:mainfrom
mattn:inotify-remove-sibling-prefix
May 4, 2026
Merged

inotify: don't remove sibling watches sharing a path prefix#754
mattn merged 1 commit into
fsnotify:mainfrom
mattn:inotify-remove-sibling-prefix

Conversation

@mattn

@mattn mattn commented May 1, 2026

Copy link
Copy Markdown
Contributor

watches.removePath used strings.HasPrefix(p, path) to find descendants of a recursive watch, so removing /tmp/a/... also dropped a sibling watch on /tmp/ab. Match on a path-separator boundary so only the target and its real descendants are removed.

removePath used strings.HasPrefix, so removing a recursive watch on
/tmp/a also dropped a sibling watch on /tmp/ab. Match on a path
boundary instead.
@mattn mattn requested a review from shogo82148 May 1, 2026 10:55
@mattn

mattn commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Plan to cut v1.10.1 once this lands.

@mattn

mattn commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Spotted the same prefix bug in two more places: recursive rename in backend_inotify.go:511 and backend_windows.go:608. Will send a separate PR.

@shogo82148 shogo82148 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ヨシッ

@mattn mattn merged commit 224257f into fsnotify:main May 4, 2026
18 checks passed
@mattn

mattn commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Thank you

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.

2 participants