2019-01-04 19:28:44

by Souptick Joarder

[permalink] [raw]
Subject: [PATCH] fs/ceph/addr.c: Convert to use vmf_error()

This code is converted to use vmf_error().

Signed-off-by: Souptick Joarder <[email protected]>
---
fs/ceph/addr.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 8eade7a..fa2a85d 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1495,10 +1495,7 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
if (err < 0 || off >= i_size_read(inode)) {
unlock_page(page);
put_page(page);
- if (err == -ENOMEM)
- ret = VM_FAULT_OOM;
- else
- ret = VM_FAULT_SIGBUS;
+ ret = vmf_error(err);
goto out_inline;
}
if (err < PAGE_SIZE)
--
1.9.1



2019-01-05 10:59:39

by Ilya Dryomov

[permalink] [raw]
Subject: Re: [PATCH] fs/ceph/addr.c: Convert to use vmf_error()

On Fri, Jan 4, 2019 at 8:26 PM Souptick Joarder <[email protected]> wrote:
>
> This code is converted to use vmf_error().
>
> Signed-off-by: Souptick Joarder <[email protected]>
> ---
> fs/ceph/addr.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 8eade7a..fa2a85d 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -1495,10 +1495,7 @@ static vm_fault_t ceph_filemap_fault(struct vm_fault *vmf)
> if (err < 0 || off >= i_size_read(inode)) {
> unlock_page(page);
> put_page(page);
> - if (err == -ENOMEM)
> - ret = VM_FAULT_OOM;
> - else
> - ret = VM_FAULT_SIGBUS;
> + ret = vmf_error(err);
> goto out_inline;
> }
> if (err < PAGE_SIZE)

Applied.

Thanks,

Ilya