]> git.hungrycats.org Git - linux/commitdiff
zygo: fs/btrfs/zlib: but why (and where) do we get EIO?
authorZygo Blaxell <zblaxell@serenity.furryterror.org>
Sat, 18 Apr 2015 23:58:26 +0000 (19:58 -0400)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Sun, 19 Apr 2015 16:07:54 +0000 (12:07 -0400)
zygo: suppress EIO from zlib_compress_pages
(cherry picked from commit 78cce10222997a34ee5e2f010f9402e801c66cc0)

zygo: fs/btrfs/zlib: but why do we get EIO?
(cherry picked from commit 1ed0a458dd17dc234417ee05b965f17b20057750)

zygo: fs/btrfs/zlib: and where do we get EIO?
(cherry picked from commit ee664e5a2282a0a553de9e04dd3c5d3c589870f7)

fs/btrfs/inode.c
fs/btrfs/zlib.c

index cbf991ff94e11ed85441e1c6318dda6c5f106202..d8da9382183ae3d87042efe414387c6b4c11e676 100644 (file)
@@ -515,6 +515,8 @@ again:
                                kunmap_atomic(kaddr);
                        }
                        will_compress = 1;
+               } else {
+                       printk(KERN_DEBUG "%s: btrfs_compress_pages failed, ret = %d, start = %lu, end = %lu", __FUNCTION__, ret, start, end);
                }
        }
 cont:
index aced36844ef2f085eaba59f714f0ec59bf9bd362..b08bde0cb3a84b35fdb073ce31c4a5b750e2159c 100644 (file)
@@ -89,6 +89,7 @@ static int zlib_compress_pages(struct list_head *ws,
        struct page *in_page = NULL;
        struct page *out_page = NULL;
        unsigned long bytes_left;
+       unsigned long saved_avail_in;
 
        *out_pages = 0;
        *total_out = 0;
@@ -181,12 +182,14 @@ static int zlib_compress_pages(struct list_head *ws,
                        workspace->strm.next_in = data_in;
                }
        }
+       saved_avail_in = workspace->strm.avail_in;
        workspace->strm.avail_in = 0;
        ret = zlib_deflate(&workspace->strm, Z_FINISH);
        zlib_deflateEnd(&workspace->strm);
 
        if (ret != Z_STREAM_END) {
-               ret = -EIEIO;
+               printk(KERN_DEBUG "%s: ret = %d, strm.avail_in = %lu, strm.avail_out = %lu, max_out = %lu, nr_pages = %d, nr_dest_pages = %lu\n", __FUNCTION__, ret, saved_avail_in, workspace->strm.avail_out, max_out, nr_pages, nr_dest_pages);
+               ret = -EIO;
                goto out;
        }