ceph: use vmf_error() in ceph_filemap_fault()
authorSouptick Joarder <jrdr.linux@gmail.com>
Fri, 4 Jan 2019 19:30:29 +0000 (01:00 +0530)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 7 Jan 2019 21:48:48 +0000 (22:48 +0100)
This code is converted to use vmf_error().

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/addr.c

index 5d0c05e288ccb3bcfc09db85b3ef949711292ad1..a47c541f800622cabf5bbbca62170d60666e8f0d 100644 (file)
@@ -1494,10 +1494,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)