Skip to content

Commit 18b9d7f

Browse files
committed
Merge PR ceph#62658 into main
* refs/pull/62658/head: libcephfs_proxy: Remove arithmetic on `void*` Reviewed-by: Patrick Donnelly <[email protected]> Reviewed-by: Matan Breizman <[email protected]> Reviewed-by: Xavi Hernandez <[email protected]>
2 parents 4a49393 + bb1fa81 commit 18b9d7f

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

.githubmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,4 @@ dubeyko Viacheslav Dubeyko <[email protected]>
195195
bill-scales Bill Scales <[email protected]>
196196
kchheda3 Krunal Chheda <[email protected]>
197197
Shwetha-Acharya Shwetha Acharya <[email protected]>
198+
xhernandez Xavi Hernandez <[email protected]>

src/libcephfs_proxy/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ set(libcephfs_proxy_srcs libcephfs_proxy.c ${proxy_common_srcs})
44

55
add_executable(libcephfsd ${libcephfsd_srcs})
66
add_library(cephfs_proxy ${CEPH_SHARED} ${libcephfs_proxy_srcs})
7-
target_compile_options(cephfs_proxy PRIVATE "-Wno-gnu-pointer-arith")
87

98
target_link_libraries(libcephfsd cephfs ${CRYPTO_LIBS})
10-
target_compile_options(libcephfsd PRIVATE "-Wno-gnu-pointer-arith")
119

1210
if(ENABLE_SHARED)
1311
set_target_properties(cephfs_proxy PROPERTIES

src/libcephfs_proxy/libcephfsd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int32_t libcephfsd_conf_set(proxy_client_t *client, proxy_req_t *req,
241241
if (err >= 0) {
242242
option = CEPH_STR_GET(req->conf_set, option, data);
243243
value = CEPH_STR_GET(req->conf_set, value,
244-
data + req->conf_set.option);
244+
(const char *)(data) + req->conf_set.option);
245245

246246
err = proxy_mount_set(mount, option, value);
247247
TRACE("ceph_conf_set(%p, '%s', '%s') -> %d", mount, option,
@@ -813,7 +813,7 @@ static int32_t libcephfsd_ll_rename(proxy_client_t *client, proxy_req_t *req,
813813
if (err >= 0) {
814814
old_name = CEPH_STR_GET(req->ll_rename, old_name, data);
815815
new_name = CEPH_STR_GET(req->ll_rename, new_name,
816-
data + req->ll_rename.old_name);
816+
(const char *)data + req->ll_rename.old_name);
817817

818818
err = ceph_ll_rename(proxy_cmount(mount), old_parent, old_name,
819819
new_parent, new_name, perms);
@@ -1223,7 +1223,7 @@ static int32_t libcephfsd_ll_setxattr(proxy_client_t *client, proxy_req_t *req,
12231223
}
12241224
if (err >= 0) {
12251225
name = CEPH_STR_GET(req->ll_setxattr, name, data);
1226-
value = data + req->ll_setxattr.name;
1226+
value = (const char *)data + req->ll_setxattr.name;
12271227
size = req->ll_setxattr.size;
12281228
flags = req->ll_setxattr.flags;
12291229

@@ -1329,7 +1329,7 @@ static int32_t libcephfsd_ll_symlink(proxy_client_t *client, proxy_req_t *req,
13291329
if (err >= 0) {
13301330
name = CEPH_STR_GET(req->ll_symlink, name, data);
13311331
value = CEPH_STR_GET(req->ll_symlink, target,
1332-
data + req->ll_symlink.name);
1332+
(const char *)data + req->ll_symlink.name);
13331333
want = req->ll_symlink.want;
13341334
flags = req->ll_symlink.flags;
13351335

src/libcephfs_proxy/proxy_link.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static int32_t proxy_link_read(proxy_link_t *link, int32_t sd, void *buffer,
8989
return proxy_log(LOG_ERR, EPIPE, "Partial read");
9090
}
9191

92-
buffer += len;
92+
buffer = (char *)buffer + len;
9393
size -= len;
9494
}
9595

@@ -117,7 +117,7 @@ static int32_t proxy_link_write(proxy_link_t *link, int32_t sd, void *buffer,
117117
return proxy_log(LOG_ERR, EPIPE, "Partial write");
118118
}
119119

120-
buffer += len;
120+
buffer = (char *)buffer + len;
121121
size -= len;
122122
}
123123

@@ -239,13 +239,13 @@ static int32_t proxy_link_negotiate_read(proxy_link_t *link, int32_t sd,
239239
proxy_link_negotiate_t *neg)
240240
{
241241
char buffer[128];
242-
void *ptr;
242+
char *ptr;
243243
uint32_t size, len;
244244
int32_t err;
245245

246246
memset(neg, 0, sizeof(proxy_link_negotiate_t));
247247

248-
ptr = neg;
248+
ptr = (char *)neg;
249249

250250
err = proxy_link_read(link, sd, ptr, sizeof(neg->v0));
251251
if (err < 0) {
@@ -706,7 +706,7 @@ int32_t proxy_link_send(int32_t sd, struct iovec *iov, int32_t count)
706706
}
707707

708708
if (count > 0) {
709-
iov->iov_base += len;
709+
iov->iov_base = (char *)iov->iov_base + len;
710710
iov->iov_len -= len;
711711
}
712712
}
@@ -746,7 +746,7 @@ int32_t proxy_link_recv(int32_t sd, struct iovec *iov, int32_t count)
746746
}
747747

748748
if (count > 0) {
749-
iov->iov_base += len;
749+
iov->iov_base = (char *)iov->iov_base + len;
750750
iov->iov_len -= len;
751751
}
752752
}
@@ -806,7 +806,7 @@ int32_t proxy_link_req_recv(int32_t sd, struct iovec *iov, int32_t count)
806806
return proxy_log(LOG_ERR, ENOBUFS,
807807
"Request is too long");
808808
}
809-
iov->iov_base += sizeof(proxy_link_req_t);
809+
iov->iov_base = (char *)iov->iov_base + sizeof(proxy_link_req_t);
810810
iov->iov_len = req->header_len - sizeof(proxy_link_req_t);
811811
} else {
812812
iov++;
@@ -877,7 +877,7 @@ int32_t proxy_link_ans_recv(int32_t sd, struct iovec *iov, int32_t count)
877877
return proxy_log(LOG_ERR, ENOBUFS,
878878
"Answer is too long");
879879
}
880-
iov->iov_base += sizeof(proxy_link_ans_t);
880+
iov->iov_base = (char *)iov->iov_base + sizeof(proxy_link_ans_t);
881881
iov->iov_len = ans->header_len - sizeof(proxy_link_ans_t);
882882
} else {
883883
iov++;

0 commit comments

Comments
 (0)