From: Jeff Layton Date: Thu, 2 May 2019 12:06:50 +0000 (-0400) Subject: ceph: fix unaligned access in ceph_send_cap_releases X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4198aba4f431e2d2c24a11cdb9d53106fda00b43;p=linux.git ceph: fix unaligned access in ceph_send_cap_releases Signed-off-by: Jeff Layton Reviewed-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 5f3f375cf0e90..959b1bf7c327d 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1855,7 +1855,8 @@ again: 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);