From: Abhishek Agarwal <agab0323@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Patrick Steinhardt <ps@pks.im>,
Paul Tarjan <github@paulisageek.com>,
Erik Cervin-Edin <erik@cervined.in>,
John Mellor <johnme@google.com>,
Nicolas Riebesel <nicolas@adamatec.com>
Subject: [PATCH 0/3] fsmonitor: fix rename handling in the Linux listener
Date: Sun, 6 Dec 2026 12:30:42 +0530 [thread overview]
Message-ID: <20261206070045.12607-1-agab0323@gmail.com> (raw)
The Linux fsmonitor listener loses track of directories in three ways.
Two of them were reported here and have not been answered yet:
1/3 Two watches can be known under the same path for a while, and
remove_watch() can then remove the wrong reverse entry. The daemon
later dies in BUG("double remove of watch"). I ran into this
because the "move_directory_up" cases of t7527 fail on my machine,
which writes core files into the current directory: the failure
is the daemon's core file showing up as an untracked file.
2/3 Directories below a renamed directory keep their old paths, so
changes in them are missed. Erik reported this in October [1].
3/3 A directory moved into the worktree from outside is not watched
itself, so changes to files directly in it are missed. John
reported this in November [2].
None of these are regressions in 2.98: the listener has behaved like
this since it was added in 2.55. I could only run the tests on Linux.
[1] https://lore.kernel.org/git/as4z1SskiPyrSKIa@vader/
[2] https://lore.kernel.org/git/CAG_kaUYEjQhiPMatcPXr00q3oO77BM2Mu7KUZyP0aSGGwKTsJA@mail.gmail.com/
Abhishek Agarwal (3):
fsmonitor: remove the right reverse entry of a watch on Linux
fsmonitor: keep watch paths below a renamed directory up to date
fsmonitor: watch directories moved into the worktree on Linux
compat/fsmonitor/fsm-listen-linux.c | 119 ++++++++++++++++++++++------
t/t7527-builtin-fsmonitor.sh | 94 ++++++++++++++++++++++
2 files changed, 188 insertions(+), 25 deletions(-)
base-commit: 566b6997dd4710b625c0882cf10a7443bf52d183
--
2.56.0
next reply other threads:[~2026-12-06 7:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 7:00 Abhishek Agarwal [this message]
2026-12-06 7:00 ` [PATCH 1/3] fsmonitor: remove the right reverse entry of a watch on Linux Abhishek Agarwal
2026-12-06 7:00 ` [PATCH 2/3] fsmonitor: keep watch paths below a renamed directory up to date Abhishek Agarwal
2026-12-06 7:00 ` [PATCH 3/3] fsmonitor: watch directories moved into the worktree on Linux Abhishek Agarwal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261206070045.12607-1-agab0323@gmail.com \
--to=agab0323@gmail.com \
--cc=erik@cervined.in \
--cc=git@vger.kernel.org \
--cc=github@paulisageek.com \
--cc=gitster@pobox.com \
--cc=johnme@google.com \
--cc=nicolas@adamatec.com \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox