aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2012-02-15 20:11:40 -0500
committerDavid Sterba <dsterba@suse.cz>2012-02-16 11:23:16 -0500
commit013bd4c336ad0d30e9e41f9cff0dbc1858934e75 (patch)
treef605d1160c95e3e82016ca8a81e6e1c3af2b7cba
parent12fc9d0923ca70ae8960bccebac09d5c12f8c4d4 (diff)
Btrfs: fix return value check of extent_io_ops
This patch adds the check on the return value of extent_io_ops. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
-rw-r--r--fs/btrfs/extent_io.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 89ba79fb945c..b05d35a7c0f1 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2154,9 +2154,10 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
2154 "this_mirror=%d, num_copies=%d, in_validation=%d\n", read_mode, 2154 "this_mirror=%d, num_copies=%d, in_validation=%d\n", read_mode,
2155 failrec->this_mirror, num_copies, failrec->in_validation); 2155 failrec->this_mirror, num_copies, failrec->in_validation);
2156 2156
2157 tree->ops->submit_bio_hook(inode, read_mode, bio, failrec->this_mirror, 2157 ret = tree->ops->submit_bio_hook(inode, read_mode, bio,
2158 failrec->bio_flags, 0); 2158 failrec->this_mirror,
2159 return 0; 2159 failrec->bio_flags, 0);
2160 return ret;
2160} 2161}
2161 2162
2162/* lots and lots of room for performance fixes in the end_bio funcs */ 2163/* lots and lots of room for performance fixes in the end_bio funcs */
@@ -2790,9 +2791,12 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
2790 delalloc_start = delalloc_end + 1; 2791 delalloc_start = delalloc_end + 1;
2791 continue; 2792 continue;
2792 } 2793 }
2793 tree->ops->fill_delalloc(inode, page, delalloc_start, 2794 ret = tree->ops->fill_delalloc(inode, page,
2794 delalloc_end, &page_started, 2795 delalloc_start,
2795 &nr_written); 2796 delalloc_end,
2797 &page_started,
2798 &nr_written);
2799 BUG_ON(ret);
2796 /* 2800 /*
2797 * delalloc_end is already one less than the total 2801 * delalloc_end is already one less than the total
2798 * length, so we don't subtract one from 2802 * length, so we don't subtract one from