提交 e8cfe009 编写于 作者: J John Ogness 提交者: Artem Bityutskiy

UBI: cleanup LEB start calculations

Wrong macro was used in calculating the data offset: UBI_EC_HDR_SIZE instead of
UBI_VID_HDR_SIZE. The data offset should be VID header offset + VID header size
(aligned to the minimum I/O unit).

This was not a bug only because currently UBI_EC_HDR_SIZE and UBI_VID_HDR_SIZE
have the same value of 64 bytes.

Commit message was amended by Artem.
Signed-off-by: NJohn Ogness <john.ogness@linutronix.de>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
上级 d4c63813
...@@ -711,7 +711,7 @@ static int io_init(struct ubi_device *ubi) ...@@ -711,7 +711,7 @@ static int io_init(struct ubi_device *ubi)
} }
/* Similar for the data offset */ /* Similar for the data offset */
ubi->leb_start = ubi->vid_hdr_offset + UBI_EC_HDR_SIZE; ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE;
ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size); ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size);
dbg_msg("vid_hdr_offset %d", ubi->vid_hdr_offset); dbg_msg("vid_hdr_offset %d", ubi->vid_hdr_offset);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册