Re: [PATCH v2 01/16] inotify: show inotify mask flags in proc fdinfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 29-03-22 10:48:49, Amir Goldstein wrote:
> The inotify mask flags IN_ONESHOT and IN_EXCL_UNLINK are not "internal
> to kernel" and should be exposed in procfs fdinfo so CRIU can restore
> them.
> 
> Fixes: 6933599697c9 ("inotify: hide internal kernel bits from fdinfo")
> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>

Good catch!

> diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
> index 57f0d5d9f934..3451708fd035 100644
> --- a/fs/notify/fdinfo.c
> +++ b/fs/notify/fdinfo.c
> @@ -83,16 +83,9 @@ static void inotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark)
>  	inode_mark = container_of(mark, struct inotify_inode_mark, fsn_mark);
>  	inode = igrab(fsnotify_conn_inode(mark->connector));
>  	if (inode) {
> -		/*
> -		 * IN_ALL_EVENTS represents all of the mask bits
> -		 * that we expose to userspace.  There is at
> -		 * least one bit (FS_EVENT_ON_CHILD) which is
> -		 * used only internally to the kernel.
> -		 */
> -		u32 mask = mark->mask & IN_ALL_EVENTS;
> -		seq_printf(m, "inotify wd:%x ino:%lx sdev:%x mask:%x ignored_mask:%x ",
> +		seq_printf(m, "inotify wd:%x ino:%lx sdev:%x mask:%x ignored_mask:0 ",
>  			   inode_mark->wd, inode->i_ino, inode->i_sb->s_dev,
> -			   mask, mark->ignored_mask);
> +			   inotify_mark_user_mask(mark));

I think inotify_mark_user_mask() helper is overdoing it a bit. Just using
INOTIFY_USER_MASK here directly is IMHO fine.

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux