Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3792780ybz; Tue, 28 Apr 2020 00:06:17 -0700 (PDT) X-Google-Smtp-Source: APiQypLNeXEJfr+HA7WN2UV167c9fDizLsj/iDDs4/JLWMgxKB9bP3xaNO1iUyZSE4Yo0ejqxddc X-Received: by 2002:a17:906:340a:: with SMTP id c10mr23764431ejb.218.1588057576974; Tue, 28 Apr 2020 00:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588057576; cv=none; d=google.com; s=arc-20160816; b=eFv+WUtK9nxll/VVrSu+BofLwgzvDgyqgZKh7Dof74mq4ckH6HEfQ8bQxiEDNWlDfc CgigLljfR3+I6zPBYmyAzdsv4SwDF74+/kI+Jlyj1H0w/9FLBbEGrNx/lzELQlYDxney Y0JNlz39W7dvBMQt39f6SqVqwZCuRWa4iSk9jNpYoELEAWZ+PGwMxcH6+vKfc5zpgqN8 sGxqW55yWhxidwB1EFG1e/qEg3aB3B+z5Y68ervpb5WLmTo8HqF6YuGtTvAKKmB9YeFG XZjRCrR6rtxG6daKWsKvB2IoduvlIO5gxIQLzY1ObRhllLgVsBcFXaPgPGzhThzLUUBs 5hwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9LBgdiDkzUJ+rA1sGPvpVzdCI0yKTW80o1Mq1pYzBm8=; b=rYdokjYS/AFpfvgRPYOfUEWPLSeB87NvCZlVefmzgvaRd3uGD6KTVVP9VhJgTHtuHn ecORsKdpNj9GrZTPd8xqzRxi6RV3s9B2/tHxoomAfiwimO8plStuKe2hEzJA2fIJmtHo QaKRV3gGH7KYy6fqf87iyOJbFK1me8zrJKFqSaG/ONeIcn+fYQGblgnWcNlQeDRkZrB+ WxTEAB3CTxfGRn9hCQVEgDHPWEviMSxUIoQo0ZKJpNjPCqffz+7I+Gv6CqFRMad5TDdq QO6iHYefHUpT6NBMYdXNTjThESXJGmx4hMucSw/9dUuZeyr59+9g4TdSDY9zj8pj3hSi gFJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j22si1299186ejm.490.2020.04.28.00.05.54; Tue, 28 Apr 2020 00:06:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726413AbgD1HCE (ORCPT + 99 others); Tue, 28 Apr 2020 03:02:04 -0400 Received: from verein.lst.de ([213.95.11.211]:54417 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbgD1HCD (ORCPT ); Tue, 28 Apr 2020 03:02:03 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 10B4D68CEC; Tue, 28 Apr 2020 09:02:01 +0200 (CEST) Date: Tue, 28 Apr 2020 09:02:00 +0200 From: Christoph Hellwig To: Martijn Coenen Cc: Christoph Hellwig , Jens Axboe , Ming Lei , Narayan Kamath , Zimuzo Ezeozue , kernel-team@android.com, linux-block , LKML , Martijn Coenen , Bart Van Assche , Chaitanya Kulkarni , Jaegeuk Kim Subject: Re: [PATCH v3 0/9] Add a new LOOP_SET_FD_AND_STATUS ioctl Message-ID: <20200428070200.GC18754@lst.de> References: <20200427074222.65369-1-maco@android.com> <20200427170613.GA13686@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2020 at 10:34:35PM +0200, Martijn Coenen wrote: > > Also maybe an explicit direct I/O flag, and maybe > > enough padding with a future proof flags bitmap that we can easily > > extend it for new features if they pop up? > > Sounds good. I'm thinking these flags should be separate from > LO_FLAGS_; even though there is already a LO_FLAGS_DIRECT_IO, as far > as I can tell it can only be used to tell whether it's enabled, not to > actually enable it. And it would just get confusing if we add more > flags later. Maybe something like LO_FD_STATUS_FLAG_DIRECT_IO ? I think reusing LO_FLAGS_DIRECT_IO makes sense to me - we have 32 flags in the existing flags field (at least for loop_info64), so we might as well use the field and the flags. Then we need flags validation in that we don't accept new flags through the old interface, and the new one validates that no unknown flags are passed. E.g. in the LOOP_SET_STATUS / LOOP_SET_STATUS64 handler do: lo->lo_flags &= ~(LO_LEGACY_FLAGS); and then in the main function reject anything not known. And then maybe add something like 64 bytes of padding to the end of the new structure, so that we can use flags to expand to it.