Prettier error message in FS if block size too large

This commit is contained in:
Ben Gras 2005-08-08 12:17:30 +00:00
parent f26239d1f8
commit 48469b737b

View file

@ -283,10 +283,16 @@ register struct super_block *sp; /* pointer to a superblock */
sp->s_nindirs = V2_INDIRECTS(sp->s_block_size);
}
if(sp->s_block_size < MIN_BLOCK_SIZE || sp->s_block_size > MAX_BLOCK_SIZE) {
if(sp->s_block_size < MIN_BLOCK_SIZE) {
printf("block size (%d) out of range\n", sp->s_block_size);
return EINVAL;
}
if(sp->s_block_size > MAX_BLOCK_SIZE) {
printf("Filesystem block size is %d kB; maximum filesystem\n"
"block size is %d kB. This limit can be increased by recompiling.\n",
sp->s_block_size/1024, MAX_BLOCK_SIZE/1024);
return EINVAL;
}
if((sp->s_block_size % 512) != 0) {
printf("block size (%d) not multiple of sector size\n",
sp->s_block_size);