From: Ben Gras Date: Fri, 22 Dec 2006 13:40:37 +0000 (+0000) Subject: . fsck needs more memory X-Git-Tag: v3.1.3~129 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/syslog.3.html?a=commitdiff_plain;h=f7984144d514d5ddb96bd16b59ae5bb4a2b7679a;p=minix.git . 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 --- diff --git a/commands/simple/Makefile b/commands/simple/Makefile index b7ae3806c..2ab7702b9 100755 --- a/commands/simple/Makefile +++ b/commands/simple/Makefile @@ -419,7 +419,7 @@ fortune: fortune.c fsck: fsck.c $(CCLD) -o $@ $? - @install -S 4096k $@ + @install -S 5120k $@ fsck1: fsck1.c $(CCLD) -o $@ $? diff --git a/commands/simple/fsck.c b/commands/simple/fsck.c index 5135de513..14cadc6bd 100755 --- a/commands/simple/fsck.c +++ b/commands/simple/fsck.c @@ -573,8 +573,11 @@ void getsuper() if (sb.s_zmap_blocks <= 0) fatal("no zmap"); 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_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. */ @@ -616,6 +619,8 @@ void chksuper() maxsize = MAX_FILE_POS; if (((maxsize - 1) >> sb.s_log_zone_size) / block_size >= MAX_ZONES) maxsize = ((long) MAX_ZONES * block_size) << sb.s_log_zone_size; + if(maxsize <= 0) + maxsize = LONG_MAX; if (sb.s_max_size != maxsize) { printf("warning: expected max size to be %ld ", maxsize); printf("instead of %ld\n", sb.s_max_size);