Author: pschweitzer
Date: Thu Jul 27 10:22:57 2017
New Revision: 75422
URL:
http://svn.reactos.org/svn/reactos?rev=75422&view=rev
Log:
[EXT2]
Import commits by Kaho Ng <ngkaho1234(a)gmail.com> from upstream:
- b7657e5 Ext3Fsd: Introduce VCB_RO_COMPAT_READ_ONLY flag for struct VCB
- e7c1142 Ext3Fsd: EXT4_FEATURE_INCOMPAT_64BIT is not supported
- 785943f Ext3Fsd: fix issue #6
Refuse mounting filesystems with incompatible flags. This avoids corrupting 64bits
filesystems.
Patch by Lubomir Rintel
CORE-13589
Modified:
trunk/reactos/drivers/filesystems/ext2/inc/ext2fs.h
trunk/reactos/drivers/filesystems/ext2/inc/linux/ext3_fs.h
trunk/reactos/drivers/filesystems/ext2/src/memory.c
trunk/reactos/media/doc/README.FSD
Modified: trunk/reactos/drivers/filesystems/ext2/inc/ext2fs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/i…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/inc/ext2fs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/inc/ext2fs.h [iso-8859-1] Thu Jul 27 10:22:57
2017
@@ -789,6 +789,7 @@
#define VCB_DEVICE_REMOVED 0x00008000
#define VCB_JOURNAL_RECOVER 0x00080000
#define VCB_ARRIVAL_NOTIFIED 0x00800000
+#define VCB_RO_COMPAT_READ_ONLY 0x01000000
#define VCB_READ_ONLY 0x08000000
#define VCB_WRITE_PROTECTED 0x10000000
#define VCB_FLOPPY_DISK 0x20000000
@@ -800,6 +801,7 @@
#define IsMounted(Vcb) (IsFlagOn((Vcb)->Flags, VCB_MOUNTED))
#define IsDispending(Vcb) (IsFlagOn((Vcb)->Flags, VCB_DISMOUNT_PENDING))
#define IsVcbReadOnly(Vcb) (IsFlagOn((Vcb)->Flags, VCB_READ_ONLY) || \
+ IsFlagOn((Vcb)->Flags, VCB_RO_COMPAT_READ_ONLY) || \
IsFlagOn((Vcb)->Flags, VCB_WRITE_PROTECTED))
Modified: trunk/reactos/drivers/filesystems/ext2/inc/linux/ext3_fs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/i…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/inc/linux/ext3_fs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/inc/linux/ext3_fs.h [iso-8859-1] Thu Jul 27
10:22:57 2017
@@ -720,7 +720,6 @@
EXT4_FEATURE_INCOMPAT_RECOVER| \
EXT4_FEATURE_INCOMPAT_META_BG| \
EXT4_FEATURE_INCOMPAT_EXTENTS| \
- EXT4_FEATURE_INCOMPAT_64BIT| \
EXT4_FEATURE_INCOMPAT_FLEX_BG)
#define EXT4_FEATURE_RO_COMPAT_SUPP ( \
EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
Modified: trunk/reactos/drivers/filesystems/ext2/src/memory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ext2/s…
==============================================================================
--- trunk/reactos/drivers/filesystems/ext2/src/memory.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ext2/src/memory.c [iso-8859-1] Thu Jul 27 10:22:57
2017
@@ -2318,15 +2318,20 @@
_SEH2_LEAVE;
}
- /* checking in/compat features */
- if (IsFlagOn(sb->s_feature_compat, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) {
- Vcb->IsExt3fs = TRUE;
- }
-
- /* don't mount any volumes with external journal devices */
- if (IsFlagOn(sb->s_feature_incompat, EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) {
+ /* Reject mounting volume if we encounter unsupported incompat features */
+ if (FlagOn(sb->s_feature_incompat, ~EXT4_FEATURE_INCOMPAT_SUPP)) {
Status = STATUS_UNRECOGNIZED_VOLUME;
_SEH2_LEAVE;
+ }
+
+ /* Mount the volume RO if we encounter unsupported ro_compat features */
+ if (FlagOn(sb->s_feature_ro_compat, ~EXT4_FEATURE_RO_COMPAT_SUPP)) {
+ SetLongFlag(Vcb->Flags, VCB_RO_COMPAT_READ_ONLY);
+ }
+
+ /* Recognize the filesystem as Ext3fs if it supports journalling */
+ if (IsFlagOn(sb->s_feature_compat, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
+ Vcb->IsExt3fs = TRUE;
}
/* check block size */
Modified: trunk/reactos/media/doc/README.FSD
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.FSD?rev=7…
==============================================================================
--- trunk/reactos/media/doc/README.FSD [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.FSD [iso-8859-1] Thu Jul 27 10:22:57 2017
@@ -9,7 +9,7 @@
The following FSD are shared with:
http://www.ext2fsd.com/
-reactos/drivers/filesystems/ext2 # Synced to 0.68
+reactos/drivers/filesystems/ext2 # Synced to 0.68, with b7657e5, e7c1142,
785943f
The following FSD are shared with:
http://www.acc.umu.se/~bosse/