summaryrefslogtreecommitdiffstats
path: root/fs/ceph/ioctl.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2018-02-17 09:29:58 +0100
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 10:12:38 +0200
commitdccbf08005df800f5c8e948ab6132ed5536134bc (patch)
tree9df1438b466899a694f724fdbdca2c0f9aca514e /fs/ceph/ioctl.c
parentlibceph: eliminate overflows in ceph_calc_file_object_mapping() (diff)
downloadlinux-dccbf08005df800f5c8e948ab6132ed5536134bc.tar.xz
linux-dccbf08005df800f5c8e948ab6132ed5536134bc.zip
libceph, ceph: change ceph_calc_file_object_mapping() signature
- make it void - xlen (object extent length) out parameter should be u32 because only a single stripe unit is mapped at a time Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'fs/ceph/ioctl.c')
-rw-r--r--fs/ceph/ioctl.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 851aa69ec8f0..b855d24a895a 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -185,7 +185,7 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
&ceph_sb_to_client(inode->i_sb)->client->osdc;
struct ceph_object_locator oloc;
CEPH_DEFINE_OID_ONSTACK(oid);
- u64 len = 1, olen;
+ u32 xlen;
u64 tmp;
struct ceph_pg pgid;
int r;
@@ -195,13 +195,8 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg)
return -EFAULT;
down_read(&osdc->lock);
- r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len,
- &dl.object_no, &dl.object_offset,
- &olen);
- if (r < 0) {
- up_read(&osdc->lock);
- return -EIO;
- }
+ ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, 1,
+ &dl.object_no, &dl.object_offset, &xlen);
dl.file_offset -= dl.object_offset;
dl.object_size = ci->i_layout.object_size;
dl.block_size = ci->i_layout.stripe_unit;