All of lore.kernel.org
 help / color / mirror / Atom feed
* Potential regression after fsnotify_nameremove() rework in 5.3
@ 2022-01-15  3:11 Ivan Delalande
  2022-01-15 19:50 ` Amir Goldstein
  2022-01-16 10:16 ` Thorsten Leemhuis
  0 siblings, 2 replies; 12+ messages in thread
From: Ivan Delalande @ 2022-01-15  3:11 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: linux-fsdevel, Jan Kara

Hi,

Sorry to bring this up so late but we might have found a regression
introduced by your "Sort out fsnotify_nameremove() mess" patch series
merged in 5.3 (116b9731ad76..7377f5bec133), and that can still be
reproduced on v5.16.

Some of our processes use inotify to watch for IN_DELETE events (for
files on tmpfs mostly), and relied on the fact that once such events are
received, the files they refer to have actually been unlinked and can't
be open/read. So if and once open() succeeds then it is a new version of
the file that has been recreated with new content.

This was true and working reliably before 5.3, but changed after
49246466a989 ("fsnotify: move fsnotify_nameremove() hook out of
d_delete()") specifically. There is now a time window where a process
receiving one of those IN_DELETE events may still be able to open the
file and read its old content before it's really unlinked from the FS.

I'm not very familiar with the VFS and fsnotify internals, would you
consider this a regression, or was there never any intentional guarantee
for that behavior and it's best we work around this change in userspace?

Thanks a lot,

-- 
Ivan Delalande
Arista Networks

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-01-28 14:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15  3:11 Potential regression after fsnotify_nameremove() rework in 5.3 Ivan Delalande
2022-01-15 19:50 ` Amir Goldstein
2022-01-16  1:20   ` Ivan Delalande
2022-01-16 10:14     ` Amir Goldstein
2022-01-17  2:34       ` Ivan Delalande
2022-01-17 13:14         ` Amir Goldstein
2022-01-17 14:21           ` Jan Kara
2022-01-17 19:09             ` Amir Goldstein
2022-01-17 22:02               ` Amir Goldstein
2022-01-18 10:06                 ` Jan Kara
2022-01-16 10:16 ` Thorsten Leemhuis
2022-01-28 14:09   ` Potential regression after fsnotify_nameremove() rework in 5.3 #forregzbot Thorsten Leemhuis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.