Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4239194ybz; Tue, 28 Apr 2020 08:01:39 -0700 (PDT) X-Google-Smtp-Source: APiQypKRhum56kKhKSFHAaAEojnZ7RuTOn4/dfiicHq/eiok9mRlQvpwh9liUSdiebwuxlKTLyWl X-Received: by 2002:a50:9f85:: with SMTP id c5mr23199125edf.278.1588086099762; Tue, 28 Apr 2020 08:01:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588086099; cv=none; d=google.com; s=arc-20160816; b=ELi3jXWDGtgnndWVXltd7D6FjY/Rx2iXGaaejQrAKyZLT8XnDRexP2BwsPsi5fRB1j E5/MJUd/Ts6Mb4Wl8oasmIC6xQ+HbsHb+MFqBBmWrjjg5S3wTQSxXoOKYPQvAMyp0AVM duSmOF3Yq3vTy5thYVMOr4XIazXoD8MyA1Ly1C6K/Lx2a+3VbLMIy74wvflWXCA4fzho xu/3KDdYKELvtCeZkQfDCcqo8lPFss0JNJgyBmGPmCTP2qzLVYiy1G37QOyX7HOk0nLv zibccO0St0GzQbllTNIYhXq5izHyuvQSa3ttc5sDqMsR62go4OKN5mke/v2D0Lbqc51l 9ybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9pYldvLV/gVCwLCXJG2H7I1itLEQ+WPd52A+pM1rS5s=; b=u779gyVefRQa/CSS8hWF5Ov7VY+X25fC38BSwUdUBAq+8mrdFoc6dgXWi/qGRqYqO8 i1f/lMw7ujsMojONKj7K9vQyM7CZQJ1mE0C8KqkmVghhH/SKFtK1SvGqDk6irYMxhALA kIYbE7X85lEeqM/pjJxZcgHW7uNH0TMWApFj+jxn3k0Opw6vAny7mKAUByeppZCkgUqu 3sXm0lYyiSfVpzvl8IcEYgheDhRUBz3FKRO7wX+YH/wTriKmgP3GJ/5bukZNYHQ17Pt0 g2bSBDMOZ4q7YLjQDFeQ9Ma8k629c+SEZPqRKGTBylREaIuNX8eENU0xK5gkEMWd97eh c3+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b="S9/mpZk6"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g25si2017298ejo.389.2020.04.28.08.01.15; Tue, 28 Apr 2020 08:01:39 -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; dkim=pass header.i=@android.com header.s=20161025 header.b="S9/mpZk6"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbgD1O5g (ORCPT + 99 others); Tue, 28 Apr 2020 10:57:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727108AbgD1O5f (ORCPT ); Tue, 28 Apr 2020 10:57:35 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B787C03C1AC for ; Tue, 28 Apr 2020 07:57:33 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id r17so17139784lff.2 for ; Tue, 28 Apr 2020 07:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9pYldvLV/gVCwLCXJG2H7I1itLEQ+WPd52A+pM1rS5s=; b=S9/mpZk6b0C8kH1z/+2Hb/MyGg1vdMdXEy2TANzfwGjfT2+7Q8xLLOkZFKhxYCDyW7 eSiY44+1bweYxGxOKKvfYbSIKiubGLJl7aY1r3hYAQaN/yt0WqXp6Dy7JgMCUrt1iBhq XCP26NXykRimBGkPPqdb7VeNein9tJ6U0rwjQ69mjBkr4d/vBuSIKVhLC3rgGc23ThqR rYQ/qk3Cy/uS4fmm9bzAtm45h1YuDjcs54cwSK716jsdXDjviOgWWkyHCh3b7Rnvj9vo PL57x1DNaqvZQAi6lmANu4XuyT+/chIaFYQdIEQnF7h73929k097NwCLVpmRmUoeY+tW FHTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9pYldvLV/gVCwLCXJG2H7I1itLEQ+WPd52A+pM1rS5s=; b=pNd3OOZUkx2+0EMkd9Syr5B096mRL5L1KB/8GT7/48rTp9rOR6ppdPeccKT6lR4yEX THlzfgnk2y4aKA+cZCg6l8zkbCpHyVK2qIoFGxtN6bjLS7vZVwRyGhQVLTs5SVGlHmh3 KoBrYeh+VwzDQP7a8PigxH/q9FaXAJcbWwlwOfN8bk/plR5P0HHjQso3X7UObLnUUKvU IpTcOg2+TUB5mIGh9NrIS6Hb0xeSrQk4QaPJAKkoVpa5MSB3nUVDj4Q9H/dLMfHJoylu inDnlzqEq7sXzH7kRAz007W2xzI3kPoDN5lYuS/Cjxyz8EV533E2rR/Ndq6MAFohCezt f+XQ== X-Gm-Message-State: AGi0Pua6cwzYp6vU8DDId+HwR5buvyzy2Z750sO07DZ9I01CXPHSoKrI /lUYlee6oM2ajsT/lToaOOwIBkg26zy4yZ2zqWPeng== X-Received: by 2002:ac2:4546:: with SMTP id j6mr19867267lfm.203.1588085851962; Tue, 28 Apr 2020 07:57:31 -0700 (PDT) MIME-Version: 1.0 References: <20200427074222.65369-1-maco@android.com> <20200427170613.GA13686@lst.de> <20200428070200.GC18754@lst.de> In-Reply-To: <20200428070200.GC18754@lst.de> From: Martijn Coenen Date: Tue, 28 Apr 2020 16:57:21 +0200 Message-ID: Subject: Re: [PATCH v3 0/9] Add a new LOOP_SET_FD_AND_STATUS ioctl To: Christoph Hellwig Cc: Jens Axboe , Ming Lei , Narayan Kamath , Zimuzo Ezeozue , kernel-team@android.com, linux-block , LKML , Martijn Coenen , Bart Van Assche , Chaitanya Kulkarni , Jaegeuk Kim Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 28, 2020 at 9:02 AM Christoph Hellwig wrote: > 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); > mmm, I thought lo_flags was read-only in LOOP_SET_STATUS(64): __u32 lo_flags; /* ioctl r/o */ but it looks LO_FLAGS_AUTOCLEAR is writable: if ((lo->lo_flags & LO_FLAGS_AUTOCLEAR) != (info->lo_flags & LO_FLAGS_AUTOCLEAR)) lo->lo_flags ^= LO_FLAGS_AUTOCLEAR; and it allows requesting a partition scan. It makes sense to maintain that behavior, but what about LO_FLAGS_DIRECT_IO? I think you're proposing LOOP_SET_STATUS(64) should keep ignoring that like it used to? Thanks, Martijn > 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.