Source kernel commit: 0bdbf89a8bbeb155644b69dc2d071a1ce23414f8

[ Also align with the latest kernel `erofs_fs.h`. ]
Signed-off-by: Gao Xiang <[email protected]>
---
 LICENSES/MIT             | 30 ++++++++++++++++++++++++++++++
 dump/main.c              |  2 +-
 include/erofs/internal.h |  2 +-
 include/erofs_fs.h       | 27 ++++++++++++++-------------
 mkfs/main.c              |  2 +-
 5 files changed, 47 insertions(+), 16 deletions(-)
 create mode 100644 LICENSES/MIT

diff --git a/LICENSES/MIT b/LICENSES/MIT
new file mode 100644
index 000000000000..f33a68ceb3ea
--- /dev/null
+++ b/LICENSES/MIT
@@ -0,0 +1,30 @@
+Valid-License-Identifier: MIT
+SPDX-URL: https://spdx.org/licenses/MIT.html
+Usage-Guide:
+  To use the MIT License put the following SPDX tag/value pair into a
+  comment according to the placement guidelines in the licensing rules
+  documentation:
+    SPDX-License-Identifier: MIT
+License-Text:
+
+MIT License
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/dump/main.c b/dump/main.c
index 57ec3b7133ce..8422bb90afbb 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -96,7 +96,7 @@ static struct erofsdump_feature feature_lists[] = {
        {  true,    0, EROFS_FEATURE_COMPAT_SB_CHKSUM, "sb_csum" },
        {  true,    0, EROFS_FEATURE_COMPAT_MTIME, "mtime" },
        {  true,    0, EROFS_FEATURE_COMPAT_XATTR_FILTER, "xattr_filter" },
-       { false, 504U, EROFS_FEATURE_INCOMPAT_ZERO_PADDING, "0padding" },
+       { false, 504U, EROFS_FEATURE_INCOMPAT_LZ4_0PADDING, "lz4_0padding" },
        { false, 513U, EROFS_FEATURE_INCOMPAT_COMPR_CFGS, "compr_cfgs" },
        { false, 513U, EROFS_FEATURE_INCOMPAT_BIG_PCLUSTER, "big_pcluster" },
        { false, 515U, EROFS_FEATURE_INCOMPAT_CHUNKED_FILE, "chunked_file" },
diff --git a/include/erofs/internal.h b/include/erofs/internal.h
index 0a5f6beeb14c..e741f1ce62f1 100644
--- a/include/erofs/internal.h
+++ b/include/erofs/internal.h
@@ -179,7 +179,7 @@ static inline void erofs_sb_clear_##name(struct 
erofs_sb_info *sbi) \
        sbi->feature_##compat &= ~EROFS_FEATURE_##feature; \
 }
 
-EROFS_FEATURE_FUNCS(lz4_0padding, incompat, INCOMPAT_ZERO_PADDING)
+EROFS_FEATURE_FUNCS(lz4_0padding, incompat, INCOMPAT_LZ4_0PADDING)
 EROFS_FEATURE_FUNCS(compr_cfgs, incompat, INCOMPAT_COMPR_CFGS)
 EROFS_FEATURE_FUNCS(big_pcluster, incompat, INCOMPAT_BIG_PCLUSTER)
 EROFS_FEATURE_FUNCS(chunked_file, incompat, INCOMPAT_CHUNKED_FILE)
diff --git a/include/erofs_fs.h b/include/erofs_fs.h
index 8b0d155f8c4c..ff8ac78f2881 100644
--- a/include/erofs_fs.h
+++ b/include/erofs_fs.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */
+/* SPDX-License-Identifier: MIT */
 /*
  * EROFS (Enhanced ROM File System) on-disk format definition
  *
@@ -13,17 +13,18 @@
 /* to allow for x86 boot sectors and other oddities. */
 #define EROFS_SUPER_OFFSET      1024
 
-#define EROFS_FEATURE_COMPAT_SB_CHKSUM          0x00000001
-#define EROFS_FEATURE_COMPAT_MTIME              0x00000002
-#define EROFS_FEATURE_COMPAT_XATTR_FILTER      0x00000004
-#define EROFS_FEATURE_COMPAT_PLAIN_XATTR_PFX   0x00000010
-#define EROFS_FEATURE_COMPAT_ISHARE_XATTRS     0x00000020
+#define EROFS_FEATURE_COMPAT_SB_CHKSUM                 0x00000001
+#define EROFS_FEATURE_COMPAT_MTIME                     0x00000002
+#define EROFS_FEATURE_COMPAT_XATTR_FILTER              0x00000004
+#define EROFS_FEATURE_COMPAT_SHARED_EA_IN_METABOX      0x00000008
+#define EROFS_FEATURE_COMPAT_PLAIN_XATTR_PFX           0x00000010
+#define EROFS_FEATURE_COMPAT_ISHARE_XATTRS             0x00000020
 
 /*
  * Any bits that aren't in EROFS_ALL_FEATURE_INCOMPAT should
  * be incompatible with this kernel version.
  */
-#define EROFS_FEATURE_INCOMPAT_ZERO_PADDING    0x00000001
+#define EROFS_FEATURE_INCOMPAT_LZ4_0PADDING    0x00000001
 #define EROFS_FEATURE_INCOMPAT_COMPR_CFGS      0x00000002
 #define EROFS_FEATURE_INCOMPAT_BIG_PCLUSTER    0x00000002
 #define EROFS_FEATURE_INCOMPAT_CHUNKED_FILE    0x00000004
@@ -50,7 +51,7 @@ struct erofs_deviceslot {
 };
 #define EROFS_DEVT_SLOT_SIZE   sizeof(struct erofs_deviceslot)
 
-/* erofs on-disk super block (currently 128 bytes) */
+/* erofs on-disk super block (currently 144 bytes at maximum) */
 struct erofs_super_block {
        __le32 magic;           /* file system magic number */
        __le32 checksum;        /* crc32c to avoid unexpected on-disk overlap */
@@ -60,7 +61,7 @@ struct erofs_super_block {
        union {
                __le16 rootnid_2b;      /* nid of root directory */
                __le16 blocks_hi;       /* (48BIT on) blocks count MSB */
-       } rb;
+       } __packed rb;
        __le64 inos;            /* total valid ino # (== f_files - f_favail) */
        __le64 epoch;           /* base seconds used for compact inodes */
        __le32 fixed_nsec;      /* fixed nanoseconds for compact inodes */
@@ -89,7 +90,7 @@ struct erofs_super_block {
        __le64 rootnid_8b;      /* (48BIT on) nid of root directory */
        __le64 reserved2;
        __le64 metabox_nid;     /* (METABOX on) nid of the metabox inode */
-       __le64 reserved3;
+       __le64 reserved3;       /* [align to extslot 1] */
 };
 
 /*
@@ -155,7 +156,7 @@ union erofs_inode_i_nb {
        __le16 nlink;           /* if EROFS_I_NLINK_1_BIT is unset */
        __le16 blocks_hi;       /* total blocks count MSB */
        __le16 startblk_hi;     /* starting block number MSB */
-};
+} __packed;
 
 /* 32-byte reduced form of an ondisk inode */
 struct erofs_inode_compact {
@@ -386,9 +387,9 @@ struct z_erofs_map_header {
                         * bit 7   : pack the whole file into packed inode
                         */
                        __u8    h_clusterbits;
-               };
+               } __packed;
                __le16 h_extents_hi;    /* extent count MSB */
-       };
+       } __packed;
 };
 
 enum {
diff --git a/mkfs/main.c b/mkfs/main.c
index 7333f1f03146..aaf5358fc735 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1678,7 +1678,7 @@ static void erofs_mkfs_default_options(struct 
erofs_importer_params *params)
        mkfs_blkszbits = ilog2(min_t(u32, getpagesize(), EROFS_MAX_BLOCK_SIZE));
        params->pclusterblks_max = 1U;
        params->pclusterblks_def = 1U;
-       g_sbi.feature_incompat = EROFS_FEATURE_INCOMPAT_ZERO_PADDING;
+       g_sbi.feature_incompat = EROFS_FEATURE_INCOMPAT_LZ4_0PADDING;
        g_sbi.feature_compat = EROFS_FEATURE_COMPAT_SB_CHKSUM |
                             EROFS_FEATURE_COMPAT_MTIME;
 }
-- 
2.43.5


Reply via email to