udev: fix vol_id ext4 detection if it has no journal.

This commit is contained in:
Arne Fitzenreiter
2012-06-26 15:09:38 +02:00
parent e384ca20f6
commit cb6ed5082d
2 changed files with 52 additions and 29 deletions

View File

@@ -0,0 +1,50 @@
diff -Naur udev-125.org/extras/volume_id/lib/ext.c udev-125/extras/volume_id/lib/ext.c
--- udev-125.org/extras/volume_id/lib/ext.c 2008-07-18 16:26:55.000000000 +0200
+++ udev-125/extras/volume_id/lib/ext.c 2012-06-25 00:52:40.976563010 +0200
@@ -160,32 +160,31 @@
goto found;
}
- /* has journal */
- if ((feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) {
- /* "use on development code" is ext4dev */
- if ((flags & EXT2_FLAGS_TEST_FILESYS) != 0) {
- id->type = "ext4dev";
- goto found;
- }
+ /* "use on development code" is ext4dev */
+ if ((flags & EXT2_FLAGS_TEST_FILESYS) != 0) {
+ id->type = "ext4dev";
+ goto found;
+ }
- /* incompatible ext3 features is ext4 */
- if ((feature_ro_compat & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) != 0 ||
- (feature_incompat & EXT3_FEATURE_INCOMPAT_UNSUPPORTED) != 0) {
- id->type = "ext4";
- goto found;
- }
+ /* incompatible ext3 features is ext4 */
+ if ((feature_ro_compat & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) != 0 ||
+ (feature_incompat & EXT3_FEATURE_INCOMPAT_UNSUPPORTED) != 0) {
+ id->type = "ext4";
+ goto found;
+ }
+ /* has journal */
+ if ((feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) {
id->type = "ext3";
goto found;
} else {
- /* no incompatible ext2 feature is ext2 */
+ /* no incompatible ext2 feature is ext2 */
if ((feature_ro_compat & EXT2_FEATURE_RO_COMPAT_UNSUPPORTED) == 0 &&
(feature_incompat & EXT2_FEATURE_INCOMPAT_UNSUPPORTED) == 0) {
id->type = "ext2";
goto found;
}
}
-
return -1;
found: