diff options
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 6d51a3da362c..0c14f8d52ee5 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2320,7 +2320,7 @@ block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | |||
2320 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 2320 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; |
2321 | unsigned long end; | 2321 | unsigned long end; |
2322 | loff_t size; | 2322 | loff_t size; |
2323 | int ret = -EINVAL; | 2323 | int ret = VM_FAULT_NOPAGE; /* make the VM retry the fault */ |
2324 | 2324 | ||
2325 | lock_page(page); | 2325 | lock_page(page); |
2326 | size = i_size_read(inode); | 2326 | size = i_size_read(inode); |
@@ -2340,10 +2340,14 @@ block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | |||
2340 | if (!ret) | 2340 | if (!ret) |
2341 | ret = block_commit_write(page, 0, end); | 2341 | ret = block_commit_write(page, 0, end); |
2342 | 2342 | ||
2343 | out_unlock: | 2343 | if (unlikely(ret)) { |
2344 | if (ret) | 2344 | if (ret == -ENOMEM) |
2345 | ret = VM_FAULT_SIGBUS; | 2345 | ret = VM_FAULT_OOM; |
2346 | else /* -ENOSPC, -EIO, etc */ | ||
2347 | ret = VM_FAULT_SIGBUS; | ||
2348 | } | ||
2346 | 2349 | ||
2350 | out_unlock: | ||
2347 | unlock_page(page); | 2351 | unlock_page(page); |
2348 | return ret; | 2352 | return ret; |
2349 | } | 2353 | } |