Re: [PATCH v2 3/3] ceph: fix unaligned access in ceph_send_cap_releases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 3, 2019 at 2:50 AM Jeff Layton <jlayton@xxxxxxxxxx> wrote:
>
> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> ---
>  fs/ceph/mds_client.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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);
> --
> 2.21.0
>

Reviewed-by: "Yan, Zheng" <zyan@xxxxxxxxxx



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux