
30 Sep
2014
30 Sep
'14
12:21 a.m.
Am 05.07.2014 11:48, schrieb Thomas Gleixner:
+/**
- ubi_calc_fm_size - calculates the fastmap size in bytes for an UBI device.
- @ubi: UBI device description object
- */
+static size_t ubi_calc_fm_size(struct ubi_scan_info *ubi) +{
- size_t size;
- size = sizeof(struct ubi_fm_hdr) + \
sizeof(struct ubi_fm_scan_pool) + \
sizeof(struct ubi_fm_scan_pool) + \
(ubi->peb_count * sizeof(struct ubi_fm_ec)) + \
(sizeof(struct ubi_fm_eba) + \
(ubi->peb_count * sizeof(__be32))) + \
sizeof(struct ubi_fm_volhdr) * UBI_MAX_VOLUMES;
- return roundup(size, ubi->leb_size);
+}
The size calculation misses sizeof(struct ubi_fm_sb). I've found this issue while working on Linux fastmap support.
Thanks, //richard