. fsck needs more memory
. fsck must deal with s_max_file_size in superblock being larger than LONG_MAX now that off_t is signed
This commit is contained in:
parent
dac2e8fcc9
commit
f7984144d5
@ -419,7 +419,7 @@ fortune: fortune.c
|
|||||||
|
|
||||||
fsck: fsck.c
|
fsck: fsck.c
|
||||||
$(CCLD) -o $@ $?
|
$(CCLD) -o $@ $?
|
||||||
@install -S 4096k $@
|
@install -S 5120k $@
|
||||||
|
|
||||||
fsck1: fsck1.c
|
fsck1: fsck1.c
|
||||||
$(CCLD) -o $@ $?
|
$(CCLD) -o $@ $?
|
||||||
|
@ -573,8 +573,11 @@ void getsuper()
|
|||||||
if (sb.s_zmap_blocks <= 0) fatal("no zmap");
|
if (sb.s_zmap_blocks <= 0) fatal("no zmap");
|
||||||
if (sb.s_firstdatazone <= 4) fatal("first data zone too small");
|
if (sb.s_firstdatazone <= 4) fatal("first data zone too small");
|
||||||
if (sb.s_log_zone_size < 0) fatal("zone size < block size");
|
if (sb.s_log_zone_size < 0) fatal("zone size < block size");
|
||||||
if (sb.s_max_size <= 0) fatal("max. file size <= 0");
|
if (sb.s_max_size <= 0) {
|
||||||
|
printf("max file size %ld ", sb.s_max_size);
|
||||||
|
sb.s_max_size = LONG_MAX;
|
||||||
|
printf("set to %ld\n", sb.s_max_size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the super block for reasonable contents. */
|
/* Check the super block for reasonable contents. */
|
||||||
@ -616,6 +619,8 @@ void chksuper()
|
|||||||
maxsize = MAX_FILE_POS;
|
maxsize = MAX_FILE_POS;
|
||||||
if (((maxsize - 1) >> sb.s_log_zone_size) / block_size >= MAX_ZONES)
|
if (((maxsize - 1) >> sb.s_log_zone_size) / block_size >= MAX_ZONES)
|
||||||
maxsize = ((long) MAX_ZONES * block_size) << sb.s_log_zone_size;
|
maxsize = ((long) MAX_ZONES * block_size) << sb.s_log_zone_size;
|
||||||
|
if(maxsize <= 0)
|
||||||
|
maxsize = LONG_MAX;
|
||||||
if (sb.s_max_size != maxsize) {
|
if (sb.s_max_size != maxsize) {
|
||||||
printf("warning: expected max size to be %ld ", maxsize);
|
printf("warning: expected max size to be %ld ", maxsize);
|
||||||
printf("instead of %ld\n", sb.s_max_size);
|
printf("instead of %ld\n", sb.s_max_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user