Get rid of the BUG_ON(ret == -ENOMEM) in __extent_read_full_page.  Thanks,

Reported-by: Jérôme Poulin <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
---
 fs/btrfs/extent_io.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b82d244..8c37cb6 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2751,12 +2751,15 @@ static int __extent_read_full_page(struct 
extent_io_tree *tree,
                                         end_bio_extent_readpage, mirror_num,
                                         *bio_flags,
                                         this_bio_flag);
-                       BUG_ON(ret == -ENOMEM);
-                       nr++;
-                       *bio_flags = this_bio_flag;
+                       if (!ret) {
+                               nr++;
+                               *bio_flags = this_bio_flag;
+                       }
                }
-               if (ret)
+               if (ret) {
                        SetPageError(page);
+                       unlock_extent(tree, cur, cur + iosize - 1);
+               }
                cur = cur + iosize;
                pg_offset += iosize;
        }
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to