diff mbox series

[v2,8/8] vfio: do not set FMODE_LSEEK flag

Message ID 20220625110115.39956-9-Jason@zx2c4.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Jason A. Donenfeld June 25, 2022, 11:01 a.m. UTC
This file does not support llseek, so don't set the flag advertising it.

Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Cc: kvm@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/vfio/vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Williamson June 27, 2022, 8:07 p.m. UTC | #1
On Sat, 25 Jun 2022 13:01:15 +0200
"Jason A. Donenfeld" <Jason@zx2c4.com> wrote:

> This file does not support llseek, so don't set the flag advertising it.
> 
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Cornelia Huck <cohuck@redhat.com>
> Cc: kvm@vger.kernel.org
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  drivers/vfio/vfio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
> index 61e71c1154be..d194dda89542 100644
> --- a/drivers/vfio/vfio.c
> +++ b/drivers/vfio/vfio.c
> @@ -1129,7 +1129,7 @@ static struct file *vfio_device_open(struct vfio_device *device)
>  	 * Appears to be missing by lack of need rather than
>  	 * explicitly prevented.  Now there's need.
>  	 */
> -	filep->f_mode |= (FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE);
> +	filep->f_mode |= (FMODE_PREAD | FMODE_PWRITE);
>  
>  	if (device->group->type == VFIO_NO_IOMMU)
>  		dev_warn(device->dev, "vfio-noiommu device opened by user "

Acked-by: Alex Williamson <alex.williamson@redhat.com>
diff mbox series

Patch

diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c
index 61e71c1154be..d194dda89542 100644
--- a/drivers/vfio/vfio.c
+++ b/drivers/vfio/vfio.c
@@ -1129,7 +1129,7 @@  static struct file *vfio_device_open(struct vfio_device *device)
 	 * Appears to be missing by lack of need rather than
 	 * explicitly prevented.  Now there's need.
 	 */
-	filep->f_mode |= (FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE);
+	filep->f_mode |= (FMODE_PREAD | FMODE_PWRITE);
 
 	if (device->group->type == VFIO_NO_IOMMU)
 		dev_warn(device->dev, "vfio-noiommu device opened by user "