Commit 34237681e02ad1617138926f437d0a147249ec13

Authored by Goldwyn Rodrigues
Committed by Linus Torvalds
1 parent 17a5b9ab32

ocfs2: clear the rest of the buffers on error

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 <rgoldwyn@suse.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff

fs/ocfs2/buffer_head_io.c
... ... @@ -316,6 +316,12 @@
316 316 bh = bhs[i];
317 317  
318 318 if (!(flags & OCFS2_BH_READAHEAD)) {
  319 + if (status) {
  320 + /* Clear the rest of the buffers on error */
  321 + put_bh(bh);
  322 + bhs[i] = NULL;
  323 + continue;
  324 + }
319 325 /* We know this can't have changed as we hold the
320 326 * owner sem. Avoid doing any work on the bh if the
321 327 * journal has it. */