[Ocfs2-devel] [PATCH] ocfs2: return f_fsid info in ocfs2_statfs(), v4

Sunil Mushran sunil.mushran at oracle.com
Sun Jan 18 07:23:18 PST 2009


f_fsid.val[1] look wrong. Just set it to zero.

On Jan 16, 2009, at 12:33 AM, Coly Li <coly.li at suse.de> wrote:

> Currently f_fsid of struct kstatfs returned from ocfs2_statfs() is  
> undefined (vfs layer fills 0 as
> default). Since in some conditions, f_fsid value might be used as  
> (f_fsid, ino) pair to
> uniquely identify a file, ocfs2 should return a unique defined  
> f_fsid value from ocfs2_statfs().
>
> Because uuid_str is identified no mater on big or litlle endian  
> machine, it's also endian consistent
> to use osb->uuid_str to generate f_fsid value.
>
> Signed-off-by: Coly Li <coly.li at suse.de>
> Cc: Sunil Mushran <sunil.mushran at oracle.com>
> Cc: Mark Fasheh <mfasheh at suse.com>
> ---
> fs/ocfs2/super.c |    4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 43ed113..c953933 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -1425,6 +1425,10 @@ static int ocfs2_statfs(struct dentry  
> *dentry, struct kstatfs *buf)
>    buf->f_bavail = buf->f_bfree;
>    buf->f_files = numbits;
>    buf->f_ffree = freebits;
> +    buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str,  
> OCFS2_VOL_UUID_LEN)
> +                & 0xFFFFFFFFUL;
> +    buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str +  
> OCFS2_VOL_UUID_LEN,
> +                OCFS2_VOL_UUID_LEN) & 0xFFFFFFFFUL;
>
>    brelse(bh);
>
> -- 
> Coly Li
> SuSE Labs
>
>
>



More information about the Ocfs2-devel mailing list