Skip to content

Commit 7c7cbad

Browse files
Artem BityutskiyArtem Bityutskiy
authored andcommitted
UBIFS: amend f_fsid
David Woodhouse suggested to be consistent with other FSes and xor the beginning and the end of the UUID. Signed-off-by: Artem Bityutskiy <[email protected]>
1 parent b3385c2 commit 7c7cbad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/ubifs/super.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ static int ubifs_statfs(struct dentry *dentry, struct kstatfs *buf)
370370
{
371371
struct ubifs_info *c = dentry->d_sb->s_fs_info;
372372
unsigned long long free;
373+
__le32 *uuid = (__le32 *)c->uuid;
373374

374375
free = ubifs_get_free_space(c);
375376
dbg_gen("free space %lld bytes (%lld blocks)",
@@ -386,8 +387,8 @@ static int ubifs_statfs(struct dentry *dentry, struct kstatfs *buf)
386387
buf->f_files = 0;
387388
buf->f_ffree = 0;
388389
buf->f_namelen = UBIFS_MAX_NLEN;
389-
memcpy(&buf->f_fsid, c->uuid, sizeof(__kernel_fsid_t));
390-
390+
buf->f_fsid.val[0] = le32_to_cpu(uuid[0]) ^ le32_to_cpu(uuid[2]);
391+
buf->f_fsid.val[1] = le32_to_cpu(uuid[1]) ^ le32_to_cpu(uuid[3]);
391392
return 0;
392393
}
393394

0 commit comments

Comments
 (0)