Re: [PATCH 19/32] VFS: Implement fsopen() to prepare for a mount [ver #8]

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

 



On Fri, May 25, 2018 at 01:07:27AM +0100, David Howells wrote:
> +	inode = alloc_anon_inode(fscontext_fs_mnt->mnt_sb);
> +	if (IS_ERR(inode))
> +		return ERR_CAST(inode);
> +	inode->i_fop = &fscontext_fs_fops;

That's almost certainly wrong - you need it only if you want it possible to
reopen via /proc/*/fd/*

> +	fc->phase = FS_CONTEXT_CREATE_PARAMS;
> +
> +	ret = -ENOMEM;
> +	path.dentry = d_alloc_pseudo(fscontext_fs_mnt->mnt_sb, &empty_name);
> +	if (!path.dentry)
> +		goto err_inode;
> +	path.mnt = mntget(fscontext_fs_mnt);
> +
> +	d_instantiate(path.dentry, inode);
> +
> +	f = alloc_file(&path, FMODE_READ | FMODE_WRITE, &fscontext_fs_fops);

Re your question on IRC - we might want that fs in longer run, but for now
just go with anon_inode_getfile() here.  Easier that way and we can always
switch later.



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

  Powered by Linux