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: <20100928195250.GA10548@fieldses.org>
Date:	Tue, 28 Sep 2010 15:52:50 -0400
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Cc:	hch@...radead.org, viro@...iv.linux.org.uk, adilger@....com,
	corbet@....net, neilb@...e.de, npiggin@...nel.dk,
	hooanon05@...oo.co.jp, miklos@...redi.hu,
	linux-fsdevel@...r.kernel.org, sfrench@...ibm.com,
	philippe.deniel@....FR, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -V20 01/12] exportfs: Return the minimum required
 handle size

On Wed, Sep 29, 2010 at 01:06:39AM +0530, Aneesh Kumar K.V wrote:
> The exportfs encode handle function should return the minimum required
> handle size. This helps user to find out the handle size by passing 0
> handle size in the first step and then redoing to the call again with
> the returned handle size value.

Just nits; seems OK otherwise:

> diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
> index 19ad145..250a347 100644
> --- a/fs/ocfs2/export.c
> +++ b/fs/ocfs2/export.c
> @@ -201,8 +201,14 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
>  		   dentry->d_name.len, dentry->d_name.name,
>  		   fh, len, connectable);
>  
> -	if (len < 3 || (connectable && len < 6)) {
> +	if (connectable && (len < 6)) {
>  		mlog(ML_ERROR, "fh buffer is too small for encoding\n");

Should that really be a printk(KERN_ERR, ...) if this is an expected use
of the interface?

> +		*max_len = 6;
> +		type = 255;
> +		goto bail;
> +	} else if (len < 3) {
> +		mlog(ML_ERROR, "fh buffer is too small for encoding\n");

Ditto.

> +		*max_len = 3;
>  		type = 255;
>  		goto bail;
>  	}
> diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
> index a9cd507..acd0b2d 100644
> --- a/include/linux/exportfs.h
> +++ b/include/linux/exportfs.h
> @@ -108,8 +108,10 @@ struct fid {
>   *    set, the encode_fh() should store sufficient information so that a good
>   *    attempt can be made to find not only the file but also it's place in the
>   *    filesystem.   This typically means storing a reference to de->d_parent in
> - *    the filehandle fragment.  encode_fh() should return the number of bytes
> - *    stored or a negative error code such as %-ENOSPC
> + *    the filehandle fragment.  encode_fh() should return the fileid_type on
> + *    success and on error returns 255 (if the space needed to encode fh is
> + *    greater than @max_len*4 bytes). On error @max_len contain the minimum

s/contain/contains/.

> + *    size(in 4 byte unit) needed to encode the file handle.
>   *
>   * fh_to_dentry:
>   *    @fh_to_dentry is given a &struct super_block (@sb) and a file handle

--b.
--
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