lkml.org 
[lkml]   [2019]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] squashfs: generate uuid for the superblock rather than leaving it zero
Date
From: Colin Ian King <colin.king@canonical.com>

The squashfs superblock uuid is currently all zero and it can be useful
to have this set. Generate the uuid based on some of squashfs superblock
data to produce a reasonable uuid pattern.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
fs/squashfs/super.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 0cc4ceec0562..ac9d17e05fac 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -193,6 +193,12 @@ static int squashfs_fill_super(struct super_block *sb, struct fs_context *fc)

err = -ENOMEM;

+ memcpy(&sb->s_uuid.b[0], &sblk->inodes, 4);
+ memcpy(&sb->s_uuid.b[4], &sblk->mkfs_time, 4);
+ memcpy(&sb->s_uuid.b[8], &sblk->fragments, 4);
+ memcpy(&sb->s_uuid.b[12], &sblk->compression, 2);
+ memcpy(&sb->s_uuid.b[14], &sblk->block_log, 2);
+
msblk->block_cache = squashfs_cache_init("metadata",
SQUASHFS_CACHED_BLKS, SQUASHFS_METADATA_SIZE);
if (msblk->block_cache == NULL)
--
2.20.1
\
 
 \ /
  Last update: 2019-11-07 16:58    [W:0.017 / U:2.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site