Skip to content

Commit

Permalink
ext4: Simplify error handling in ext4_dax_huge_fault()
Browse files Browse the repository at this point in the history
If transaction starting fails, just bail out of the function immediately
instead of checking for that condition throughout the function.

Reviewed-by: Ross Zwisler <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
jankara authored and djbw committed Nov 3, 2017
1 parent 71eab6d commit 497f692
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fs/ext4/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,17 @@ static int ext4_dax_huge_fault(struct vm_fault *vmf,
down_read(&EXT4_I(inode)->i_mmap_sem);
handle = ext4_journal_start_sb(sb, EXT4_HT_WRITE_PAGE,
EXT4_DATA_TRANS_BLOCKS(sb));
if (IS_ERR(handle)) {
up_read(&EXT4_I(inode)->i_mmap_sem);
sb_end_pagefault(sb);
return VM_FAULT_SIGBUS;
}
} else {
down_read(&EXT4_I(inode)->i_mmap_sem);
}
if (!IS_ERR(handle))
result = dax_iomap_fault(vmf, pe_size, NULL, &ext4_iomap_ops);
else
result = VM_FAULT_SIGBUS;
result = dax_iomap_fault(vmf, pe_size, NULL, &ext4_iomap_ops);
if (write) {
if (!IS_ERR(handle))
ext4_journal_stop(handle);
ext4_journal_stop(handle);
up_read(&EXT4_I(inode)->i_mmap_sem);
sb_end_pagefault(sb);
} else {
Expand Down

0 comments on commit 497f692

Please sign in to comment.