Skip to content

Commit 687475c

Browse files
committed
db/update/InotifyUpdate: handle IN_CREATE without IN_ISDIR
A new symlink causes `IN_CREATE`. Usually, we catch `IN_CREATE` only with IN_ISDIR to watch the new directory, but otherwise `IN_CREATE` is not handled. Regular files are "created" but they have usable content only with `IN_CLOSE_WRITE`. Yet symlinks have only `IN_CREATE` and they are immediately usable. Closes #2192
1 parent c48dbd5 commit 687475c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ver 0.23.17 (not yet released)
22
* storage
33
- nfs: require libnfs 4.0 or later
4+
* database
5+
- inotify: trigger update after symlink was created
46
* support libfmt 11.1
57

68
ver 0.23.16 (2024/12/03)

src/db/update/InotifyUpdate.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ InotifyUpdate::InotifyCallback(int wd, unsigned mask,
293293
}
294294

295295
if ((mask & (IN_CLOSE_WRITE|IN_MOVE|IN_DELETE)) != 0 ||
296+
/* regular file or symlink was created; this check is only
297+
interesting for symlinks because regular files have
298+
usable content only after IN_CLOSE_WRITE */
299+
(mask & (IN_CREATE|IN_ISDIR)) == IN_CREATE ||
296300
/* at the maximum depth, we watch out for newly created
297301
directories */
298302
(directory.GetDepth() == max_depth &&

0 commit comments

Comments
 (0)