Re: [PATCH] secretmem: move setting O_LARGEFILE and bumping users' count to the place where we create the file

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

 



On Sun, 15 Jun 2025 01:35:07 +0100 Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:

> [don't really care which tree that goes through; right now it's
> in viro/vfs.git #work.misc, but if somebody prefers to grab it
> through a different tree, just say so]

(cc Mike)

> --- a/mm/secretmem.c
> +++ b/mm/secretmem.c
> @@ -208,7 +208,7 @@ static struct file *secretmem_file_create(unsigned long flags)
>  	}
>  
>  	file = alloc_file_pseudo(inode, secretmem_mnt, "secretmem",
> -				 O_RDWR, &secretmem_fops);
> +				 O_RDWR | O_LARGEFILE, &secretmem_fops);
>  	if (IS_ERR(file))
>  		goto err_free_inode;
>  
> @@ -222,6 +222,8 @@ static struct file *secretmem_file_create(unsigned long flags)
>  	inode->i_mode |= S_IFREG;
>  	inode->i_size = 0;
>  
> +	atomic_inc(&secretmem_users);
> +
>  	return file;
>  
>  err_free_inode:
> @@ -255,9 +257,6 @@ SYSCALL_DEFINE1(memfd_secret, unsigned int, flags)
>  		goto err_put_fd;
>  	}
>  
> -	file->f_flags |= O_LARGEFILE;
> -
> -	atomic_inc(&secretmem_users);
>  	fd_install(fd, file);
>  	return fd;
>  

Acked-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

Please retain this in the vfs tree.




[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