fs: fs_devread should log error when read outside partition
Log the error if fs_devread() fails when trying to reading outside partition. This will make bug reporting easier. Signed-off-by: Tony Dinh <mibodhi@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ int fs_devread(struct blk_desc *blk, struct disk_partition *partition,
|
|||||||
/* Check partition boundaries */
|
/* Check partition boundaries */
|
||||||
if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))
|
if ((sector + ((byte_offset + byte_len - 1) >> log2blksz))
|
||||||
>= partition->size) {
|
>= partition->size) {
|
||||||
log_debug("read outside partition " LBAFU "\n", sector);
|
log_err("** Read outside partition " LBAFU "\n", sector);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user