Commit ec137c10 authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: fix uninline data function

For CEPH_OSD_CMPXATTR_MODE_U64, OSD expects the u64 to be encoded
as string in object's xattr.
Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent 0ea611a3
......@@ -1539,19 +1539,27 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page)
osd_req_op_extent_osd_data_pages(req, 1, &page, len, 0, false, false);
{
__le64 xattr_buf = cpu_to_le64(inline_version);
err = osd_req_op_xattr_init(req, 0, CEPH_OSD_OP_CMPXATTR,
"inline_version", &inline_version,
sizeof(inline_version),
"inline_version", &xattr_buf,
sizeof(xattr_buf),
CEPH_OSD_CMPXATTR_OP_GT,
CEPH_OSD_CMPXATTR_MODE_U64);
if (err)
goto out_put;
}
{
char xattr_buf[32];
int xattr_len = snprintf(xattr_buf, sizeof(xattr_buf),
"%llu", inline_version);
err = osd_req_op_xattr_init(req, 2, CEPH_OSD_OP_SETXATTR,
"inline_version", &inline_version,
sizeof(inline_version), 0, 0);
"inline_version",
xattr_buf, xattr_len, 0, 0);
if (err)
goto out_put;
}
ceph_osdc_build_request(req, 0, NULL, CEPH_NOSNAP, &inode->i_mtime);
err = ceph_osdc_start_request(&fsc->client->osdc, req, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment