Comment 15 for bug 1824407

Revision history for this message
Colin Ian King (colin-king) wrote :

Adding a uuid into the superblock on squashfs seems to resolve the issue. Since squashfs does not have UUID support, my hack below generates one based on some squashfs superblock metadata that provides a good enough UUID for our purposes.

diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index effa638d6d85..cfb34a75feb6 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -186,6 +186,12 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
        sb->s_flags |= SB_RDONLY;
        sb->s_op = &squashfs_super_ops;

+ 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);
+
        err = -ENOMEM;

        msblk->block_cache = squashfs_cache_init("metadata",