|
From: Anton B. <an...@sa...> - 2012-03-09 00:26:48
|
On Tue, 1 Nov 2011 08:27:05 +1100
Anton Blanchard <an...@sa...> wrote:
> The ppc64 Fedora 16 installer triggers lots of warnings about
> accessing past the end of a device:
Looks like this hasn't been merged yet. Here it is, rediffed against
mainline.
Anton
--
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.
---
Index: squashfs/squashfs-tools/mksquashfs.c
===================================================================
--- squashfs.orig/squashfs-tools/mksquashfs.c 2012-03-09 11:07:29.335618550 +1100
+++ squashfs/squashfs-tools/mksquashfs.c 2012-03-09 11:07:30.211633762 +1100
@@ -5046,7 +5046,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, "
@@ -5518,9 +5518,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);
|