Import commits by Kaho Ng <ngkaho1234@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
svn path=/trunk/; revision=75422
#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
#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))
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| \
_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 */
Vcb->BlockSize = (EXT2_MIN_BLOCK_SIZE << sb->s_log_block_size);
/* we cannot handle volume with block size bigger than 64k */
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/