projects
/
platform
/
upstream
/
erofs-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51c01dd
)
erofs-utils: fix EOD behavior when len is too large
author
Gao Xiang
<hsiangkao@linux.alibaba.com>
Sat, 3 Jun 2023 13:31:30 +0000
(21:31 +0800)
committer
Gao Xiang
<hsiangkao@linux.alibaba.com>
Tue, 6 Jun 2023 14:19:30 +0000
(22:19 +0800)
Otherwise, read_count could be overflow and causes unexpected
behaviors.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20230603133130.34364-2-hsiangkao@linux.alibaba.com
lib/io.c
patch
|
blob
|
history
diff --git
a/lib/io.c
b/lib/io.c
index 9e30b7e13341431e297e0a9291ce1df6dee5d7a4..9d718ab704dcfdf676848034e7db7f6bd7499c18 100644
(file)
--- a/
lib/io.c
+++ b/
lib/io.c
@@
-289,7
+289,7
@@
int dev_read(int device_id, void *buf, u64 offset, size_t len)
erofs_info("Reach EOF of device - %s:[%" PRIu64 ", %zd].",
erofs_devname, offset, len);
memset(buf, 0, len);
- re
ad_count = len
;
+ re
turn 0
;
} else if (errno != EINTR) {
erofs_err("Failed to read data from device - %s:[%" PRIu64 ", %zd].",
erofs_devname, offset, len);