Re: [PATCH 16/20] xfs: use bios directly to read and write the log recovery buffers

Christoph Hellwig
2019-06-05T15:10:19Z

> > +
> > + if (is_vmalloc && op == REQ_OP_READ)
> > + flush_kernel_vmap_range(data, count);
>
> That should be REQ_OP_WRITE. i.e. the data the CPU has written to
> the aliased vmap address has to be flushed back to the physical page
> before the DMA from the physical page to the storage device occurs.

Actually it probably should be unconditional, so that we have a
clean cache to start with. That also matches what xfs_buf.c does.

> > + if (is_vmalloc && op == REQ_OP_WRITE)
> > + invalidate_kernel_vmap_range(data, count);
>
> And this should be REQ_OP_READ - to invalidate anything aliased in
> the CPU cache before the higher layers try to read the new data in
> the physical page...

Fixed.