aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_aops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_aops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 4d191ef39b67..1fcdc0abda6e 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -136,9 +136,10 @@ xfs_destroy_ioend(
136 136
137 for (bh = ioend->io_buffer_head; bh; bh = next) { 137 for (bh = ioend->io_buffer_head; bh; bh = next) {
138 next = bh->b_private; 138 next = bh->b_private;
139 bh->b_end_io(bh, ioend->io_uptodate); 139 bh->b_end_io(bh, !ioend->io_error);
140 } 140 }
141 141 if (unlikely(ioend->io_error))
142 vn_ioerror(ioend->io_vnode, ioend->io_error, __FILE__,__LINE__);
142 vn_iowake(ioend->io_vnode); 143 vn_iowake(ioend->io_vnode);
143 mempool_free(ioend, xfs_ioend_pool); 144 mempool_free(ioend, xfs_ioend_pool);
144} 145}
@@ -185,7 +186,7 @@ xfs_end_bio_unwritten(
185 size_t size = ioend->io_size; 186 size_t size = ioend->io_size;
186 int error; 187 int error;
187 188
188 if (ioend->io_uptodate) 189 if (likely(!ioend->io_error))
189 VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error); 190 VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error);
190 xfs_destroy_ioend(ioend); 191 xfs_destroy_ioend(ioend);
191} 192}
@@ -211,7 +212,7 @@ xfs_alloc_ioend(
211 * all the I/O from calling the completion routine too early. 212 * all the I/O from calling the completion routine too early.
212 */ 213 */
213 atomic_set(&ioend->io_remaining, 1); 214 atomic_set(&ioend->io_remaining, 1);
214 ioend->io_uptodate = 1; /* cleared if any I/O fails */ 215 ioend->io_error = 0;
215 ioend->io_list = NULL; 216 ioend->io_list = NULL;
216 ioend->io_type = type; 217 ioend->io_type = type;
217 ioend->io_vnode = vn_from_inode(inode); 218 ioend->io_vnode = vn_from_inode(inode);
@@ -271,16 +272,14 @@ xfs_end_bio(
271 if (bio->bi_size) 272 if (bio->bi_size)
272 return 1; 273 return 1;
273 274
274 ASSERT(ioend);
275 ASSERT(atomic_read(&bio->bi_cnt) >= 1); 275 ASSERT(atomic_read(&bio->bi_cnt) >= 1);
276 ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error;
276 277
277 /* Toss bio and pass work off to an xfsdatad thread */ 278 /* Toss bio and pass work off to an xfsdatad thread */
278 if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
279 ioend->io_uptodate = 0;
280 bio->bi_private = NULL; 279 bio->bi_private = NULL;
281 bio->bi_end_io = NULL; 280 bio->bi_end_io = NULL;
282
283 bio_put(bio); 281 bio_put(bio);
282
284 xfs_finish_ioend(ioend); 283 xfs_finish_ioend(ioend);
285 return 0; 284 return 0;
286} 285}