On Mon 07-03-22 17:57:36, Amir Goldstein wrote: > Jan, > > Following RFC discussion [1], following are the volatile mark patches. > > Tested both manually and with this LTP test [2]. > I was struggling with this test for a while because drop caches > did not get rid of the un-pinned inode when test was run with > ext2 or ext4 on my test VM. With xfs, the test works fine for me, > but it may not work for everyone. > > Perhaps you have a suggestion for a better way to test inode eviction. Drop caches does not evict dirty inodes. The inode is likely dirty because you have chmodded it just before drop caches. So I think calling sync or syncfs before dropping caches should fix your problems with ext2 / ext4. I suspect this has worked for XFS only because it does its private inode dirtiness tracking and keeps the inode behind VFS's back. Honza > > Thanks, > Amir. > > [1] https://lore.kernel.org/linux-fsdevel/CAOQ4uxiRDpuS=2uA6+ZUM7yG9vVU-u212tkunBmSnP_u=mkv=Q@xxxxxxxxxxxxxx/ > [2] https://github.com/amir73il/ltp/commits/fan_volatile > > Amir Goldstein (5): > fsnotify: move inotify control flags to mark flags > fsnotify: pass flags argument to fsnotify_add_mark() > fsnotify: allow adding an inode mark without pinning inode > fanotify: add support for exclusive create of mark > fanotify: add support for "volatile" inode marks > > fs/notify/fanotify/fanotify_user.c | 32 +++++++++-- > fs/notify/fsnotify.c | 4 +- > fs/notify/inotify/inotify_fsnotify.c | 2 +- > fs/notify/inotify/inotify_user.c | 40 +++++++++----- > fs/notify/mark.c | 83 +++++++++++++++++++++++----- > include/linux/fanotify.h | 9 ++- > include/linux/fsnotify_backend.h | 32 ++++++----- > include/uapi/linux/fanotify.h | 2 + > kernel/audit_fsnotify.c | 3 +- > 9 files changed, 151 insertions(+), 56 deletions(-) > > -- > 2.25.1 > -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR