]> Git Repo - u-boot.git/commitdiff
zfs: Fix return value of fs_devread()
author[email protected] <[email protected]>
Sun, 7 Apr 2024 01:47:28 +0000 (18:47 -0700)
committerTom Rini <[email protected]>
Wed, 17 Apr 2024 16:08:56 +0000 (10:08 -0600)
As evidenced by how other filesystems handle it, a return value of 0
from fs_devread() means failure; nonzero means success. The opposite
assumption was being made in zfs.c for the use of zfs_devread() so fix
the confusion by making zfs_devread() return 0 on success.

It probably doesn't make sense to change the handling of zfs_devread()
in zfs.c instead, because as it is it matches the semantics of the other
functions there.

Signed-off-by: Phaedrus Leeds <[email protected]>
fs/zfs/dev.c

index 251e7d1f74fc54c68596e65f553a97dfff7dbd09..fcd9893b3ac2fb8798eff06c7d316b3496d9eb70 100644 (file)
@@ -26,5 +26,5 @@ void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
 int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
 {
        return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
-                         byte_len, buf);
+                         byte_len, buf) ? 0 : 1;
 }
This page took 0.033647 seconds and 4 git commands to generate.