提交 b77bcb07 编写于 作者: Z Zoltan Sogor 提交者: Artem Bityutskiy

UBI: fix EBADMSG handling

'ubi_io_read_data()' may return EBADMSG in case of an ECC error,
and we should not panic because of this. We have CRC32 checksum
and may check the data. So just ignore the EBADMSG error.

This patch also fixes a minor spelling error at the same time.
Signed-off-by: NZoltan Sogor <weth@inf.u-szeged.hu>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
上级 45beca08
...@@ -1022,7 +1022,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to, ...@@ -1022,7 +1022,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
} }
/* /*
* OK, now the LEB is locked and we can safely start moving iy. Since * OK, now the LEB is locked and we can safely start moving it. Since
* this function utilizes thie @ubi->peb1_buf buffer which is shared * this function utilizes thie @ubi->peb1_buf buffer which is shared
* with some other functions, so lock the buffer by taking the * with some other functions, so lock the buffer by taking the
* @ubi->buf_mutex. * @ubi->buf_mutex.
......
...@@ -320,7 +320,7 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb, ...@@ -320,7 +320,7 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
} }
err = ubi_io_read_data(ubi, buf, pnum, 0, len); err = ubi_io_read_data(ubi, buf, pnum, 0, len);
if (err && err != UBI_IO_BITFLIPS) if (err && err != UBI_IO_BITFLIPS && err != -EBADMSG)
goto out_free_buf; goto out_free_buf;
data_crc = be32_to_cpu(vid_hdr->data_crc); data_crc = be32_to_cpu(vid_hdr->data_crc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册