libceph: make ceph_pr_addr take an struct ceph_entity_addr pointer
GCC9 is throwing a lot of warnings about unaligned accesses by callers of ceph_pr_addr. All of the current callers are passing a pointer to the sockaddr inside struct ceph_entity_addr. Fix it to take a pointer to a struct ceph_entity_addr instead, and then have the function make a copy of the sockaddr before printing it. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:

committed by
Ilya Dryomov

parent
cede185b1b
commit
b726ec972c
@@ -76,7 +76,7 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end)
|
||||
m->num_mon);
|
||||
for (i = 0; i < m->num_mon; i++)
|
||||
dout("monmap_decode mon%d is %s\n", i,
|
||||
ceph_pr_addr(&m->mon_inst[i].addr.in_addr));
|
||||
ceph_pr_addr(&m->mon_inst[i].addr));
|
||||
return m;
|
||||
|
||||
bad:
|
||||
@@ -203,7 +203,7 @@ static void reopen_session(struct ceph_mon_client *monc)
|
||||
{
|
||||
if (!monc->hunting)
|
||||
pr_info("mon%d %s session lost, hunting for new mon\n",
|
||||
monc->cur_mon, ceph_pr_addr(&monc->con.peer_addr.in_addr));
|
||||
monc->cur_mon, ceph_pr_addr(&monc->con.peer_addr));
|
||||
|
||||
__close_session(monc);
|
||||
__open_session(monc);
|
||||
@@ -1178,7 +1178,7 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
|
||||
__resend_generic_request(monc);
|
||||
|
||||
pr_info("mon%d %s session established\n", monc->cur_mon,
|
||||
ceph_pr_addr(&monc->con.peer_addr.in_addr));
|
||||
ceph_pr_addr(&monc->con.peer_addr));
|
||||
}
|
||||
|
||||
out:
|
||||
|
Reference in New Issue
Block a user