FS size sanity check

ganesh@cse.iitb.ernet.in
Wed, 11 Feb 1998 03:44:47 +0530 (IST)


Shouldn't there be a sanity check somewhere to see that the filesystem size is
<= device size before mounting ? It seems that this is not done, at least
for msdos. We just had a case where a dos fs which thought it was 2GB was
actually sitting in a 1 GB partition with the rest of the disk being linux,
leading to a lot of grief when it overran into the linux partitions. Looks
like someone had repartitioned the disk for installing linux without bothering
to use fips or reformatting the dos side.
Although the situation was definitely caused by user stupidity, I think there
should at least be a warning somewhere while mounting such a "dangerous" fs.
The question is, should it be in userspace (mount), or in the kernel ? If
in the kernel, each fs should probably do the check in its read_super since
there are some fs's like compressed fs's whose advertised size legitimately
exceeds the block device size.

-- ganesh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu