Skip to content

Commit d8cddf2

Browse files
fdmananakdave
authored andcommitted
btrfs: don't return VM_FAULT_SIGBUS on failure to set delalloc for mmap write
If the call to btrfs_set_extent_delalloc() fails we are always returning VM_FAULT_SIGBUS, which is odd since the error means "bad access" and the most likely cause for btrfs_set_extent_delalloc() is -ENOMEM, which should be translated to VM_FAULT_OOM. Instead of returning VM_FAULT_SIGBUS return vmf_error(ret2), which gives us a more appropriate return value, and we use that everywhere else too. Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent a08625f commit d8cddf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,7 @@ static vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)
19371937
&cached_state);
19381938
if (ret2) {
19391939
btrfs_unlock_extent(io_tree, page_start, page_end, &cached_state);
1940-
ret = VM_FAULT_SIGBUS;
1940+
ret = vmf_error(ret2);
19411941
goto out_unlock;
19421942
}
19431943

0 commit comments

Comments
 (0)