]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: return errno instead of -1 from compression
authorZach Brown <zab@redhat.com>
Fri, 9 May 2014 21:15:08 +0000 (17:15 -0400)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:20:21 +0000 (17:20 -0700)
commit4cafa37b17092862546a2e859094a09d2586751f
treeeee37a1df3a53564e3d38d15d65d63c0a437e9c7
parenta23eb9fe420474ca91aae5f8e0e2030717757794
btrfs: return errno instead of -1 from compression

The compression layer seems to have been built to return -1 and have
callers make up errors that make sense.  This isn't great because there
are different errors that originate down in the compression layer.

Let's return real negative errnos from the compression layer so that
callers can pass on the error without having to guess what happened.
ENOMEM for allocation failure, E2BIG when compression exceeds the
uncompressed input, and EIO for everything else.

This helps a future path return errors from btrfs_decompress().

Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/lzo.c
fs/btrfs/zlib.c