Whamcloud - gitweb
Add support for the read-only feature
authorTheodore Ts'o <tytso@mit.edu>
Mon, 23 Feb 2015 17:54:15 +0000 (12:54 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 23 Feb 2015 18:04:47 +0000 (13:04 -0500)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/e2p/feature.c
lib/ext2fs/ext2_fs.h
lib/ext2fs/ext2fs.h
misc/tune2fs.8.in
misc/tune2fs.c

index 30d2db1..73884f2 100644 (file)
@@ -68,6 +68,8 @@ static struct feature feature_list[] = {
                        "metadata_csum"},
        {       E2P_FEATURE_RO_INCOMPAT, EXT4_FEATURE_RO_COMPAT_REPLICA,
                        "replica" },
+       {       E2P_FEATURE_RO_INCOMPAT, EXT4_FEATURE_RO_COMPAT_READONLY,
+                       "read-only" },
 
        {       E2P_FEATURE_INCOMPAT, EXT2_FEATURE_INCOMPAT_COMPRESSION,
                        "compression" },
index 10cb650..6715d4e 100644 (file)
@@ -754,6 +754,8 @@ struct ext2_super_block {
  */
 #define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM   0x0400
 #define EXT4_FEATURE_RO_COMPAT_REPLICA         0x0800
+#define EXT4_FEATURE_RO_COMPAT_READONLY                0x1000
+
 
 #define EXT2_FEATURE_INCOMPAT_COMPRESSION      0x0001
 #define EXT2_FEATURE_INCOMPAT_FILETYPE         0x0002
index f090df1..93d9940 100644 (file)
@@ -608,7 +608,8 @@ typedef struct ext2_icount *ext2_icount_t;
                                         EXT4_FEATURE_RO_COMPAT_GDT_CSUM|\
                                         EXT4_FEATURE_RO_COMPAT_BIGALLOC|\
                                         EXT4_LIB_RO_COMPAT_QUOTA|\
-                                        EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)
+                                        EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\
+                                        EXT4_FEATURE_RO_COMPAT_READONLY)
 
 /*
  * These features are only allowed if EXT2_FLAG_SOFTSUPP_FEATURES is passed
index c50d475..9d1df82 100644 (file)
@@ -567,6 +567,9 @@ Enable or disable multiple mount protection (MMP) feature.
 @QUOTA_MAN_COMMENT@.B quota
 @QUOTA_MAN_COMMENT@Enable internal file system quota inodes.
 .TP
+.B read-only
+Force the kernel to mount the file system read-only.
+.TP
 .B sparse_super
 Limit the number of backup superblocks to save space on large filesystems.
 .TP
index 258121f..550932d 100644 (file)
@@ -160,7 +160,8 @@ static __u32 ok_features[3] = {
 #ifdef CONFIG_QUOTA
                EXT4_FEATURE_RO_COMPAT_QUOTA |
 #endif
-               EXT4_FEATURE_RO_COMPAT_METADATA_CSUM
+               EXT4_FEATURE_RO_COMPAT_METADATA_CSUM |
+               EXT4_FEATURE_RO_COMPAT_READONLY
 };
 
 static __u32 clear_ok_features[3] = {
@@ -182,7 +183,8 @@ static __u32 clear_ok_features[3] = {
 #ifdef CONFIG_QUOTA
                EXT4_FEATURE_RO_COMPAT_QUOTA |
 #endif
-               EXT4_FEATURE_RO_COMPAT_METADATA_CSUM
+               EXT4_FEATURE_RO_COMPAT_METADATA_CSUM |
+               EXT4_FEATURE_RO_COMPAT_READONLY
 };
 
 /**