On Fri, Nov 29, 2024 at 11:57 AM Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > On Thu, Nov 28, 2024 at 6:00 PM Mateusz Guzik <mjguzik@xxxxxxxxx> wrote: > > > > On Thu, Nov 28, 2024 at 5:57 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > > > > > On Thu, Nov 28, 2024 at 3:34 PM Mateusz Guzik <mjguzik@xxxxxxxxx> wrote: > > > > so this depends on FMODE_FSNOTIFY_HSM showing up on the file before any > > > > of the above calls and staying there for its lifetime -- does that hold? > > > > > > Yes! > > > > > > > ok > > > > In this case the new routines should come with a comment denoting it, > > otherwise the code looks incredibly suspicious. > > How's this: > > /* > * Do not prevent write to executable file when watched by pre-content events. > * > * (*) FMODE_FSNOTIFY_HSM mode is set depending on pre-content watches at the > * time of file open and remains for entire lifetime of the file, so if > * pre-content watches are added post execution or removed before the end > * of the execution, it will not cause i_writecount reference leak. > */ > Looks good, thank you! -- Mateusz Guzik <mjguzik gmail.com>