Dave Wysochanski <dwyso...@redhat.com> wrote:

> @@ -203,7 +203,7 @@ bool cachefiles_set_volume_xattr(struct cachefiles_volume 
> *volume)
>       if (!buf)
>               return false;
>       buf->reserved = cpu_to_be32(0);
> -     memcpy(buf->data, p, len);
> +     memcpy(buf->data, p, volume->vcookie->coherency_len);

Good catch.  However, I think it's probably better to change things a bit
further up, eg.:

        -       len += sizeof(*buf);
        -       buf = kmalloc(len, GFP_KERNEL);
        +       buf = kmalloc(sizeof(*buf) + len, GFP_KERNEL);

David
--
Linux-cachefs mailing list
Linux-cachefs@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-cachefs

Reply via email to