Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 795c7a44 authored by Jin Qian's avatar Jin Qian Committed by Gerrit - the friendly Code Review server
Browse files

f2fs: sanity check segment count



F2FS uses 4 bytes to represent block address. As a result, supported
size of disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments.

Change-Id: I64d9be6dcc4ab5d8a45359c69d6163ed0209e8fe
Signed-off-by: default avatarJin Qian <jinqian@google.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git


Git-commit: b9dd46188edc2f0d1f37328637860bb65a771124
Signed-off-by: default avatarDennis Cagle <dcagle@codeaurora.org>
parent 023fb720
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -289,6 +289,12 @@ struct f2fs_nat_block {
 */
#define F2FS_MAX_SEGMENT       ((16 * 1024 * 1024) / 2)

/*
 * F2FS uses 4 bytes to represent block address. As a result, supported size of
 * disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments.
 */
#define F2FS_MAX_SEGMENT       ((16 * 1024 * 1024) / 2)

/*
 * Note that f2fs_sit_entry->vblocks has the following bit-field information.
 * [15:10] : allocation type such as CURSEG_XXXX_TYPE