|
From: Anton B. <an...@sa...> - 2011-10-31 21:27:16
|
The ppc64 Fedora 16 installer triggers lots of warnings about accessing
past the end of a device:
attempt to access beyond end of device
loop0: rw=0, want=20586, limit=20488
The ppc64 kernel uses a page size of 64kB but mksquashfs only pads to
a 4kB boundary. When we loopback mount a squashfs file that isn't 64kB
aligned and access the last sector of the associated loopback device we
see a stream of errors. Disk partitioning tools seem to like accessing
the last 512 bytes of partitions.
At a minimum, ppc64, sparc64 and ia64 will be broken without this fix.
There are config options to set a non 4kB page size on many other
architectures and if selected they would break too.
---
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index 5dc1c0e..1d0ae2a 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -4931,7 +4931,7 @@ printOptions:
ERROR("-force-uid uid\t\tset all file uids to uid\n");
ERROR("-force-gid gid\t\tset all file gids to gid\n");
ERROR("-nopad\t\t\tdo not pad filesystem to a multiple "
- "of 4K\n");
+ "of 64K\n");
ERROR("-keep-as-directory\tif one source directory is "
"specified, create a root\n");
ERROR("\t\t\tdirectory containing that directory, "
@@ -5403,9 +5403,9 @@ restore_filesystem:
SQUASHFS_INSWAP_SUPER_BLOCK(&sBlk);
write_destination(fd, SQUASHFS_START, sizeof(sBlk), &sBlk);
- if(!nopad && (i = bytes & (4096 - 1))) {
- char temp[4096] = {0};
- write_destination(fd, bytes, 4096 - i, temp);
+ if(!nopad && (i = bytes & (65536 - 1))) {
+ char temp[65536] = {0};
+ write_destination(fd, bytes, 65536 - i, temp);
}
close(fd);
|