Skip to content

Commit

Permalink
ocfs2: clear the rest of the buffers on error
Browse files Browse the repository at this point in the history
In case a validation fails, clear the rest of the buffers and return the
error to the calling function.

This also facilitates bubbling up the error originating from ocfs2_error
to calling functions.

Signed-off-by: Goldwyn Rodrigues <[email protected]>
Reviewed-by: Mark Fasheh <[email protected]>
Cc: Joel Becker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Goldwyn Rodrigues authored and torvalds committed Sep 4, 2015
1 parent 17a5b9a commit 3423768
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/ocfs2/buffer_head_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 3423768

Please sign in to comment.