On Mon, May 13, 2019 at 7:33 PM Jan Kara <jack@xxxxxxx> wrote: > > On Fri 10-05-19 18:24:42, Amir Goldstein wrote: > > On Thu, May 9, 2019 at 1:31 PM Jan Kara <jack@xxxxxxx> wrote: > > > On Wed 08-05-19 19:09:56, Amir Goldstein wrote: > > > > On Tue, May 7, 2019 at 10:12 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > > > > Yes, I much prefer this solution myself and I will follow up with it, > > > > > but it would not be honest to suggest said solution as a stable fix > > > > > to the performance regression that was introduced in v5.1. > > > > > I think is it better if you choose between lesser evil: > > > > > v1 with ifdef CONFIG_FSNOTIFY to fix build issue > > > > > v2 as subtle as it is > > > > > OR another obviously safe stable fix that you can think of > > > > > > > > > > The change of cleansing d_delete() from fsnotify_nameremove() > > > > > requires more research and is anyway not stable tree material - > > > > > if not for the level of complexity, then because all the users of > > > > > FS_DELETE from pseudo and clustered filesystems need more time > > > > > to find regressions (we do not have test coverage for those in LTP). > > > > > > > > > > > > > Something like this: > > > > https://github.com/amir73il/linux/commits/fsnotify_nameremove > > > > > > > > Only partially tested. Obviously haven't tested all callers. > > > > > > Not quite. I'd add the fsnotify_nameremove() call also to simple_rmdir() > > > and simple_unlink(). That takes care of: > > > arch/s390/hypfs/inode.c, drivers/infiniband/hw/qib/qib_fs.c, > > > fs/configfs/dir.c, fs/debugfs/inode.c, fs/tracefs/inode.c, > > > net/sunrpc/rpc_pipe.c > > > > > > > simple_unlink() is used as i_op->unlink() implementation of simple > > filesystems, such as: fs/pstore/inode.c fs/ramfs/inode.c > > fs/ocfs2/dlmfs/dlmfs.c fs/hugetlbfs/inode.c kernel/bpf/inode.c > > > > If we place fsnotify hook in the filesystem implementation and not > > in vfs_unlink(), what will cover normal fs? If we do place fsnotify hook > > in vfs_unlink(), then we have a double call to hook. > > > > The places we add explicit fsnofity hooks should only be call sites that > > do not originate from vfs_unlink/vfs_rmdir. > > Hum, right. I didn't realize simple_unlink() gets also called through > vfs_unlink() for some filesystems. But then I'd rather create variants > simple_unlink_notify() and simple_rmdir_notify() than messing with > d_delete(). As I just think that fsnotify call in d_delete() happens at a > wrong layer. d_delete() is about dcache management, not really about > filesystem name removal which is what we want to notify about. > Agreed. I'll follow up with this solution, hopefully after the stable regression fix is already merged. Thanks, Amir.