Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 7c02f94

Browse files
pengzhou777PaulLawrenceGoogle
authored andcommitted
ANDROID: Incremental fs: fix magic compatibility again
It's still magic number issue which cannot be compatible with arm-32 platform, although we try to fix it in Iae4f3877444 ("ANDROID: Incremental fs: magic number compatible 32-bit"), there is still incompatible scenario, such as: get_incfs_node(), it will return NULL then kernel exception will be trigger because of NULL pointer access. (inode_set() -> get_incfs_node(), then used node->xxx directly) We change magic number directly, otherwise, we must fix above issues one by one. Bug: 159772865 Fixes: Iae4f3877444("ANDROID: Incremental fs: magic number compatible 32-bit") Signed-off-by: Peng Zhou <[email protected]> Signed-off-by: mtk81325 <[email protected]> Change-Id: I71f279c1bb55ea296ab33a47644f30df4a9f60a6
1 parent 1ff3ab2 commit 7c02f94

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/incfs/vfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,7 @@ struct dentry *incfs_mount_fs(struct file_system_type *type, int flags,
22222222
sb->s_op = &incfs_super_ops;
22232223
sb->s_d_op = &incfs_dentry_ops;
22242224
sb->s_flags |= S_NOATIME;
2225-
sb->s_magic = (long)INCFS_MAGIC_NUMBER;
2225+
sb->s_magic = INCFS_MAGIC_NUMBER;
22262226
sb->s_time_gran = 1;
22272227
sb->s_blocksize = INCFS_DATA_FILE_BLOCK_SIZE;
22282228
sb->s_blocksize_bits = blksize_bits(sb->s_blocksize);

include/uapi/linux/incrementalfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/* ===== constants ===== */
2020
#define INCFS_NAME "incremental-fs"
21-
#define INCFS_MAGIC_NUMBER (0x5346434e49ul)
21+
#define INCFS_MAGIC_NUMBER (unsigned long)(0x5346434e49ul)
2222
#define INCFS_DATA_FILE_BLOCK_SIZE 4096
2323
#define INCFS_HEADER_VER 1
2424

0 commit comments

Comments
 (0)