erofs-utils: fix erofs_io_p{read,write} and erofs_dev_close
authorHongzhen Luo <hongzhen@linux.alibaba.com>
Wed, 19 Jun 2024 02:50:24 +0000 (10:50 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 19 Jun 2024 03:11:23 +0000 (11:11 +0800)
commit97f48b3c37f53316dd073bea94d002c51fb5b505
treeee51afca2607c995b72a65a2e045879e07dcd27f
parentda17cdb03d7647963f4719b0083f423bc9afa715
erofs-utils: fix erofs_io_p{read,write} and erofs_dev_close

erofs_io_p{read,write} should return the number of bytes
successfully {read,write}.

This also fixes `erofs_dev_close` which could close random
fds if `vf->ops` is NULL.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240619025024.1109782-1-hsiangkao@linux.alibaba.com
include/erofs/internal.h
lib/io.c