mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 01:59:54 +00:00
libf2fs: limit the total size up to 16T
F2FS can support 16T bytes at most. Limit the config.total_sectors so that most parameters calculated according to it in sb/cp can be limited correctly too. Signed-off-by: Junling Zheng <zhengjunling@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
c00fe85bc7
commit
ea34c1ce14
@ -640,6 +640,11 @@ int f2fs_get_device_info(struct f2fs_configuration *c)
|
||||
c->total_sectors = wanted_total_sectors;
|
||||
|
||||
}
|
||||
if (c->total_sectors * c->sector_size >
|
||||
(u_int64_t)F2FS_MAX_SEGMENT * 2 * 1024 * 1024) {
|
||||
MSG(0, "\tError: F2FS can support 16TB at most!!!\n");
|
||||
return -1;
|
||||
}
|
||||
MSG(0, "Info: sector size = %u\n", c->sector_size);
|
||||
MSG(0, "Info: total sectors = %"PRIu64" (%"PRIu64" MB)\n",
|
||||
c->total_sectors, (c->total_sectors *
|
||||
|
Loading…
Reference in New Issue
Block a user