summaryrefslogtreecommitdiffstats
path: root/kernel/fs/ocfs2/buffer_head_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/ocfs2/buffer_head_io.c')
-rw-r--r--kernel/fs/ocfs2/buffer_head_io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/fs/ocfs2/buffer_head_io.c b/kernel/fs/ocfs2/buffer_head_io.c
index 1edcb141f..fe50ded1b 100644
--- a/kernel/fs/ocfs2/buffer_head_io.c
+++ b/kernel/fs/ocfs2/buffer_head_io.c
@@ -316,6 +316,12 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
bh = bhs[i];
if (!(flags & OCFS2_BH_READAHEAD)) {
+ if (status) {
+ /* Clear the rest of the buffers on error */
+ put_bh(bh);
+ bhs[i] = NULL;
+ continue;
+ }
/* We know this can't have changed as we hold the
* owner sem. Avoid doing any work on the bh if the
* journal has it. */