Re: [PATCH vfio] vfio: Use get_user_pages_longterm correctly

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

 



On Sat, Jun 30, 2018 at 02:17:48PM -0600, Alex Williamson wrote:
> On Fri, 29 Jun 2018 11:31:50 -0600
> Jason Gunthorpe <jgg@xxxxxxxxxxxx> wrote:
> 
> > The patch noted in the fixes below converted get_user_pages_fast() to
> > get_user_pages_longterm(), however the two calls differ in a few ways.
> > 
> > First _fast() is documented to not require the mmap_sem, while _longterm()
> > is documented to need it. Hold the mmap sem as required.
> > 
> > Second, _fast accepts an 'int write' while _longterm uses 'unsigned int
> > gup_flags', so the expression '!!(prot & IOMMU_WRITE)' is only working by
> > luck as FOLL_WRITE is currently == 0x1. Use the expected FOLL_WRITE
> > constant instead.
> > 
> > Fixes: 94db151dc892 ("vfio: disable filesystem-dax page pinning")
> > Cc: <stable@xxxxxxxxxxxxxxx>
> > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >  drivers/vfio/vfio_iommu_type1.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Minor change as shown below, we don't need both branches coming up with
> the FOLL_WRITE flag in slightly different ways.

Looks good, thanks

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux