diff --git a/src/add-ons/kernel/file_systems/ext2/Volume.cpp b/src/add-ons/kernel/file_systems/ext2/Volume.cpp index cf9bff9347..f89e8173a4 100644 --- a/src/add-ons/kernel/file_systems/ext2/Volume.cpp +++ b/src/add-ons/kernel/file_systems/ext2/Volume.cpp @@ -401,8 +401,7 @@ Volume::Mount(const char* deviceName, uint32 flags) TRACE("Volume::Mount(): Initialized block cache: %p\n", fBlockCache); // initialize journal if mounted read-write - if (!IsReadOnly() && - (fSuperBlock.CompatibleFeatures() & EXT2_FEATURE_HAS_JOURNAL) != 0) { + if (!IsReadOnly() && HasJournalFeature()) { // TODO: There should be a mount option to ignore the existent journal if (fSuperBlock.JournalInode() != 0) { fJournalInode = new(std::nothrow) Inode(this, diff --git a/src/add-ons/kernel/file_systems/ext2/Volume.h b/src/add-ons/kernel/file_systems/ext2/Volume.h index 37618dbe88..369b88394e 100644 --- a/src/add-ons/kernel/file_systems/ext2/Volume.h +++ b/src/add-ons/kernel/file_systems/ext2/Volume.h @@ -80,6 +80,9 @@ public: bool IndexedDirectories() const { return (fSuperBlock.CompatibleFeatures() & EXT2_FEATURE_DIRECTORY_INDEX) != 0; } + bool HasJournalFeature() const + { return (fSuperBlock.CompatibleFeatures() + & EXT2_FEATURE_HAS_JOURNAL) != 0; } bool Has64bitFeature() const { return (fSuperBlock.IncompatibleFeatures() & EXT2_INCOMPATIBLE_FEATURE_64BIT) != 0; } diff --git a/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp b/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp index 1bc83cd64e..e1e47ac4a2 100644 --- a/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp @@ -175,7 +175,12 @@ ext2_read_fs_info(fs_volume* _volume, struct fs_info* info) strlcpy(info->volume_name, volume->Name(), sizeof(info->volume_name)); // File system name - strlcpy(info->fsh_name, "ext2", sizeof(info->fsh_name)); + if (volume->HasExtentsFeature()) + strlcpy(info->fsh_name, "ext4", sizeof(info->fsh_name)); + else if (volume->HasJournalFeature()) + strlcpy(info->fsh_name, "ext3", sizeof(info->fsh_name)); + else + strlcpy(info->fsh_name, "ext2", sizeof(info->fsh_name)); return B_OK; }