lkml.org 
[lkml]   [2005]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ext3: return FSID for statvfs
On Dec 06, 2005  22:23 +0200, Pekka Enberg wrote:
> This patch changes ext3_statfs() to return a FSID based on least significant
> 64-bits of the 128-bit filesystem UUID. This patch is a partial fix for
> Bugzilla Bug <http://bugzilla.kernel.org/show_bug.cgi?id=136>.

The bug mentions some reasons why this patch is sub-optimal - namely that
the beginning of the UUID has common fields in it. It may make more sense
to e.g. XOR the first 2 * u32 with the last 2 * u32 to reduce the chance
of an FSID collision.

Also, there is a tiny memory of a security issue with exposing the FSID
to applications (something to do with NFS and guessing filehandles or
similar). I have no idea if that is even relevant any longer, but
thought I'd mention it.

> @@ -2340,6 +2340,8 @@ static int ext3_statfs (struct super_blo
> buf->f_files = le32_to_cpu(es->s_inodes_count);
> buf->f_ffree = ext3_count_free_inodes (sb);
> buf->f_namelen = EXT3_NAME_LEN;
> + buf->f_fsid.val[0] = le32_to_cpup((void *)es->s_uuid);
> + buf->f_fsid.val[1] = le32_to_cpup((void *)es->s_uuid + sizeof(u32));
> return 0;
> }
>

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-07 13:43    [W:0.055 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site