On 2/5/25 09:47, Alistair Popple wrote:
> FS DAX requires file systems to call into the DAX layout prior to unlinking
> inodes to ensure there is no ongoing DMA or other remote access to the
> direct mapped page. The fuse file system implements
> fuse_dax_break_layouts() to do this which includes a comment indicating
> that passing dmap_end == 0 leads to unmapping of the whole file.
> 
> However this is not true - passing dmap_end == 0 will not unmap anything
> before dmap_start, and further more dax_layout_busy_page_range() will not
> scan any of the range to see if there maybe ongoing DMA access to the
> range. Fix this by passing -1 for dmap_end to fuse_dax_break_layouts()
> which will invalidate the entire file range to
> dax_layout_busy_page_range().
> 
> Signed-off-by: Alistair Popple <apop...@nvidia.com>
> Co-developed-by: Dan Williams <dan.j.willi...@intel.com>
> Signed-off-by: Dan Williams <dan.j.willi...@intel.com>
> Fixes: 6ae330cad6ef ("virtiofs: serialize truncate/punch_hole and dax fault 
> path")
> Cc: Vivek Goyal <vgo...@redhat.com>
> 

Looks good

Reviewed-by: Balbir Singh <balb...@nvidia.com>

Reply via email to