diff options
author | Karel Zak <kzak@redhat.com> | 2005-09-06 06:26:45 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2005-09-06 06:26:45 -0400 |
commit | 05a6edf4fdf3beb93d22116cf4ec39d161ab2790 (patch) | |
tree | 58b16ed2ecb754f20dcf15c45ad0e0488ce06086 /lib/blkid | |
parent | 68a7f959c0af3d6e32cf9339433667f04b8a1c56 (diff) | |
download | e2fsprogs-05a6edf4fdf3beb93d22116cf4ec39d161ab2790.tar.gz |
Fix blkid library so that the cache validation notices ext2 to ext3 conversion
There's mistake in blkid ext2 detection code. The libblkid doesn't
check for journal when revalidate the cache information about an ext2
device.
# rm -f /etc/blkid.tab
# mkfs.ext2 /dev/loop0 &> /dev/null
# blkid -s TYPE /dev/loop0
/dev/loop0: TYPE="ext2"
# mkfs.ext3 /dev/loop0 &> /dev/null
# blkid -s TYPE /dev/loop0
/dev/loop0: TYPE="ext2"
That bug doesn't appear when libblkid creates new cache and checks for
all possible filesystems, because it tries ext3 before ext2. BUT when
the library only revalidate the cache it first probes for old cached
filesystem (e.g. ext2).
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/blkid')
-rw-r--r-- | lib/blkid/ChangeLog | 6 | ||||
-rw-r--r-- | lib/blkid/probe.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index 1bb8cd31..0d0607b5 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,9 @@ +2005-09-05 Karel Zak <kzak@redhat.com> + + * probe.c (probe_ext2): Check to see if a journal has been added + to an ext2 filesystem when revalidating cached information + about an ext2 device. + 2005-07-25 Theodore Ts'o <tytso@mit.edu> * cache.c (safe_getenv): Pass in zero to the unusued arguments of diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index 6756e977..116a0ca6 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -136,6 +136,11 @@ static int probe_ext2(int fd __BLKID_ATTR((unused)), if (blkid_le32(es->s_feature_incompat) & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) return -BLKID_ERR_PARAM; + + /* Distinguish between ext3 and ext2 */ + if ((blkid_le32(es->s_feature_compat) & + EXT3_FEATURE_COMPAT_HAS_JOURNAL)) + return -BLKID_ERR_PARAM; get_ext2_info(dev, buf); |