From patchwork Fri Jun 24 16:56:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 12894885 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C6D4C433EF for ; Fri, 24 Jun 2022 16:57:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230167AbiFXQ5h (ORCPT ); Fri, 24 Jun 2022 12:57:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231526AbiFXQ5V (ORCPT ); Fri, 24 Jun 2022 12:57:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1604755A; Fri, 24 Jun 2022 09:57:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CEC41B82AC2; Fri, 24 Jun 2022 16:57:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0C0EC34114; Fri, 24 Jun 2022 16:57:16 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="Ii/t9VVT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1656089836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FIjn5iV3Bi5t5Qq6rqpqsdlzBuYh8dn6H7cyAt8zXHg=; b=Ii/t9VVTon2KjniVjG7mzemPtgF+7QKF8k8vjTXbnmD8feAavwX2YiPhIzZlzZWmX22QkY BovRL+fMSsIReNmKuxYr9BUJkjRc9PXLmuEG8iO+irgQvFflTKiOQYzUltZgEOTO4Y17xH TC62Ch92DoaRWM3L8ELI4n7b9IN3xt8= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 9dbbde04 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 24 Jun 2022 16:57:15 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, Jens Axboe , linux-fsdevel@vger.kernel.org Cc: "Jason A. Donenfeld" , Alex Williamson , Cornelia Huck , kvm@vger.kernel.org Subject: [PATCH 6/6] vfio: do not set FMODE_LSEEK flag Date: Fri, 24 Jun 2022 18:56:31 +0200 Message-Id: <20220624165631.2124632-7-Jason@zx2c4.com> In-Reply-To: <20220624165631.2124632-1-Jason@zx2c4.com> References: <20220624165631.2124632-1-Jason@zx2c4.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org This file does not support llseek, so don't set the flag advertising it. Cc: Alex Williamson Cc: Cornelia Huck Cc: kvm@vger.kernel.org Signed-off-by: Jason A. Donenfeld --- 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 "