Commit 497f6926 authored by Jan Kara's avatar Jan Kara Committed by Dan Williams

ext4: Simplify error handling in ext4_dax_huge_fault()

If transaction starting fails, just bail out of the function immediately
instead of checking for that condition throughout the function.
Reviewed-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 71eab6df
...@@ -302,16 +302,17 @@ static int ext4_dax_huge_fault(struct vm_fault *vmf, ...@@ -302,16 +302,17 @@ static int ext4_dax_huge_fault(struct vm_fault *vmf,
down_read(&EXT4_I(inode)->i_mmap_sem); down_read(&EXT4_I(inode)->i_mmap_sem);
handle = ext4_journal_start_sb(sb, EXT4_HT_WRITE_PAGE, handle = ext4_journal_start_sb(sb, EXT4_HT_WRITE_PAGE,
EXT4_DATA_TRANS_BLOCKS(sb)); 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 { } else {
down_read(&EXT4_I(inode)->i_mmap_sem); down_read(&EXT4_I(inode)->i_mmap_sem);
} }
if (!IS_ERR(handle)) result = dax_iomap_fault(vmf, pe_size, NULL, &ext4_iomap_ops);
result = dax_iomap_fault(vmf, pe_size, NULL, &ext4_iomap_ops);
else
result = VM_FAULT_SIGBUS;
if (write) { if (write) {
if (!IS_ERR(handle)) ext4_journal_stop(handle);
ext4_journal_stop(handle);
up_read(&EXT4_I(inode)->i_mmap_sem); up_read(&EXT4_I(inode)->i_mmap_sem);
sb_end_pagefault(sb); sb_end_pagefault(sb);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment