lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131213163916.GG20803@infradead.org>
Date:	Fri, 13 Dec 2013 08:39:16 -0800
From:	Christoph Hellwig <hch@...radead.org>
To:	Zhi Yong Wu <zwu.kernel@...il.com>
Cc:	xfs@....sgi.com, linux-fsdevel@...r.kernel.org,
	Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] xfs: add a new method xfs_vn_tmpfile()

On Fri, Dec 13, 2013 at 10:27:52PM +0800, Zhi Yong Wu wrote:
> From: Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>
> 
> Add a new O_TMPFILE method to VFS inteface.
> For more info, please refer to:
>   http://oss.sgi.com/archives/xfs/2013-08/msg00336.html
> 
> Signed-off-by: Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>
> ---
>  fs/xfs/xfs_iops.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> index eb55be5..b57cd89 100644
> --- a/fs/xfs/xfs_iops.c
> +++ b/fs/xfs/xfs_iops.c
> @@ -39,6 +39,7 @@
>  #include "xfs_da_btree.h"
>  #include "xfs_dir2_priv.h"
>  #include "xfs_dinode.h"
> +#include "xfs_trans_space.h"
>  
>  #include <linux/capability.h>
>  #include <linux/xattr.h>
> @@ -1051,6 +1052,25 @@ xfs_vn_fiemap(
>  	return 0;
>  }
>  
> +STATIC int
> +xfs_vn_tmpfile(
> +	struct inode	*dir,
> +	struct dentry	*dentry,
> +	umode_t		mode)
> +{
> +	struct xfs_inode *ip = NULL;
> +	int		error;
> +
> +	error = xfs_create_tmpfile(XFS_I(dir), XFS_I(dir)->i_mount,

No need to pass in the mount point here, the client can get it easily.

> +				mode, 0, &ip);

Also no need for an always-zero argument.

> +	if (error)
> +		return -error;
> +
> +	d_instantiate(dentry, VFS_I(ip));

Shouldn't this be a call to d_tmpfile() instead?

Also I'd suggest mergin this into the previous patch, so that we have
one that actually adds O_TMPFILE support, and once place to write a nice
good changelog.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ