[2/3] ceph: fix unaligned access in ceph_send_cap_releases
diff mbox series

Message ID 20190502153757.29038-2-jlayton@kernel.org
State New
Headers show
Series
  • [1/3] libceph: make ceph_pr_addr take an struct ceph_entity_addr pointer
Related show

Commit Message

Jeff Layton May 2, 2019, 3:37 p.m. UTC
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/mds_client.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index e09773a7a9cf..66eae336a68a 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1855,7 +1855,8 @@  static void ceph_send_cap_releases(struct ceph_mds_client *mdsc,
 		num_cap_releases--;
 
 		head = msg->front.iov_base;
-		le32_add_cpu(&head->num, 1);
+		put_unaligned_le32(get_unaligned_le32(&head->num) + 1,
+				   &head->num);
 		item = msg->front.iov_base + msg->front.iov_len;
 		item->ino = cpu_to_le64(cap->cap_ino);
 		item->cap_id = cpu_to_le64(cap->cap_id);