diff options
author | Souptick Joarder <jrdr.linux@gmail.com> | 2018-04-14 23:18:59 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-06-07 16:53:13 +0300 |
commit | 31c49eac780b3bcd1e34d71c2f5c79527b26e86c (patch) | |
tree | 3f8c043463543a95b22fd10d1706faccd8c4eb66 /fs/ubifs/file.c | |
parent | 29dcea88779c856c7dc92040a0c01233263101d4 (diff) | |
download | linux-31c49eac780b3bcd1e34d71c2f5c79527b26e86c.tar.xz |
fs: ubifs: Adding new return type vm_fault_t
Use new return type vm_fault_t for page_mkwrite handler.
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/file.c')
-rw-r--r-- | fs/ubifs/file.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 1acb2ff505e6..28b80713a163 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1513,7 +1513,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags) * mmap()d file has taken write protection fault and is being made writable. * UBIFS must ensure page is budgeted for. */ -static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) +static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf) { struct page *page = vmf->page; struct inode *inode = file_inode(vmf->vma->vm_file); @@ -1567,8 +1567,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) if (unlikely(page->mapping != inode->i_mapping || page_offset(page) > i_size_read(inode))) { /* Page got truncated out from underneath us */ - err = -EINVAL; - goto out_unlock; + goto sigbus; } if (PagePrivate(page)) @@ -1597,12 +1596,10 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) wait_for_stable_page(page); return VM_FAULT_LOCKED; -out_unlock: +sigbus: unlock_page(page); ubifs_release_budget(c, &req); - if (err) - err = VM_FAULT_SIGBUS; - return err; + return VM_FAULT_SIGBUS; } static const struct vm_operations_struct ubifs_file_vm_ops = { |