On Thu, Dec 5, 2024 at 1:55 PM Jan Kara <jack@xxxxxxx> wrote: > > On Thu 28-11-24 15:25:32, Amir Goldstein wrote: > > Commit 2a010c412853 ("fs: don't block i_writecount during exec") removed > > the legacy behavior of getting ETXTBSY on attempt to open and executable > > file for write while it is being executed. > > > > This commit was reverted because an application that depends on this > > legacy behavior was broken by the change. > > > > We need to allow HSM writing into executable files while executed to > > fill their content on-the-fly. > > > > To that end, disable the ETXTBSY legacy behavior for files that are > > watched by pre-content events. > > > > This change is not expected to cause regressions with existing systems > > which do not have any pre-content event listeners. > > > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> > > OK, I've picked up the patch to fsnotify_hsm branch with Christian's ack > and updated comments from Amir. Still waiting for Josef to give this a > final testing from their side but I've pulled the branch into for_next so > that it gets some exposure in linux-next as well. Cool. I just pushed a test to my LTP fan_hsm branch for ETXTBSY. It checks for the expected ETXTBSY with yes or no pre-content watchers, but it checks failure to execute a file open for write, not actually to open a file for write in the context of PRE_ACCESS event during execution. So yeh, a test of the actual use case of large lazy populated executables from Josef is required, but at least we have basic sanity test coverage and now we will get some extra linux-next testing coverage which is great. Thanks, Amir.