Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1701229rdb; Mon, 2 Oct 2023 19:57:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGenjDQMWV3Qq9WYcMbkGoms8bNQwL9g9ut3nrMskK+K7zHaEOVap39wIG6leFT6LvxT+to X-Received: by 2002:a0d:e294:0:b0:573:bb84:737c with SMTP id l142-20020a0de294000000b00573bb84737cmr13549043ywe.26.1696301863750; Mon, 02 Oct 2023 19:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696301863; cv=none; d=google.com; s=arc-20160816; b=uoNXzgokGpt607NTEodHBbxGvN4vCsq3FnUY8NXuKYuSidcThegqyq2OXtaEsdpWoG Dfi4ca9cenbHvfeGHNxcnFiwtxoYUwKAyoheP2O+9XEJQ5GKpX7OTaioTYRli6uN9rpi A+B/cAT2XaGH5A0PCEoQcre4h6RRJHOQdywAozT6cx9R9lrnpm5imMvdsrsu2FjYVSJq Or9xk8PIriOszCS+TzyFFb/blY//ZLdsKrPrUZUYTcFH8D8wXj/UCPELcryuFWdrGPyt Y0HakCgOphMpNpxsxavVjs9fGjwFPX168BggCZyFwyC+Wg84wRcME7lTSEg0t0rVbRTZ yP6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UyjxDdLQ8L1D7BuXl6m07qK11nzUfRpTIYFbsYyEs9M=; fh=eZZ0jM4fRktZTNtN0XrCJvnVgsCkZPtvJKjiF4laPD8=; b=acziwVhT1FEqWpOXq/GIgETRneapyBLeZJAzPXp6BZsUNAX+yWkLX1eRpSAQbFyOXo bTzp/WMrNRp8CNw5LqqG30jHBkc20La6/E8XT50UuBLx+m9JqBJphn5JVN4/QPHgiICm ee5ftYErblLEvaf9Zrx5Wjsj1xZoQTjviYxe88VNJl+La/MmOmf2W1iuX2z5PTQiifqM SAIB6RTTKbsxSOgwnm84KsGKfh3i9dUwdP+xBDjO05bZtGPWZppFSnoTrgbdQm0JpfsH k3A6BEce4iazGRECHz/TKkQpPeAd9LcG4Hnam2GyoPO2cNqla84nRVQrIp5qcGo/SBGv pttg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fcq3zcCo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id mh11-20020a17090b4acb00b002792c288cc2si419846pjb.170.2023.10.02.19.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 19:57:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fcq3zcCo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3EF3B80E6FC5; Mon, 2 Oct 2023 19:57:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230098AbjJCC5I (ORCPT + 99 others); Mon, 2 Oct 2023 22:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjJCC5H (ORCPT ); Mon, 2 Oct 2023 22:57:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 835AAA1; Mon, 2 Oct 2023 19:57:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A19CC433C7; Tue, 3 Oct 2023 02:57:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696301824; bh=VaFWFM5fxDWGkb8H1vk6Bq8dR22TjRNx4fMlMFNeYbA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Fcq3zcCoO8Cw3fSu03I/MN7v4SZVVerKmQLt2XdPAdd7oRhQuf/3qGM718GYYKXHr XYLU3kV10AQEcShXicFobffOpIo33qy2nJhifxPjZROX1vPVEEt0c8Pz3JkK/8jbIT 6LVV4LblD5xEPcQDCvNh7+FXEWbywSAq5R7Arlb9QueR6vapcefnZ2kHNvdW/OyJP/ 9eY+eZ0+4caJ2Nx2QB6+hdzRq61ZL115VvKrna6IYqrqH1D680fWp8IxG+bAtUNo7O ZG4OuNPJzfpH1L6gTDg2BwvvXSB5MDg3XIwWbOQa7fnSrhQeGW/0/YK4SrYySgvCkB zS58IZ7Vc1rzw== Date: Mon, 2 Oct 2023 19:57:03 -0700 From: "Darrick J. Wong" To: Dave Chinner Cc: John Garry , Bart Van Assche , Eric Biggers , axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org, Prasad Singamsetty Subject: Re: [PATCH 03/21] fs/bdev: Add atomic write support info to statx Message-ID: <20231003025703.GD21298@frogsfrogsfrogs> References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-4-john.g.garry@oracle.com> <20230929224922.GB11839@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 19:57:41 -0700 (PDT) On Tue, Oct 03, 2023 at 12:51:49PM +1100, Dave Chinner wrote: > On Mon, Oct 02, 2023 at 10:51:36AM +0100, John Garry wrote: > > On 01/10/2023 14:23, Bart Van Assche wrote: > > > On 9/29/23 15:49, Eric Biggers wrote: > > > > On Fri, Sep 29, 2023 at 10:27:08AM +0000, John Garry wrote: > > > > > diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h > > > > > index 7cab2c65d3d7..c99d7cac2aa6 100644 > > > > > --- a/include/uapi/linux/stat.h > > > > > +++ b/include/uapi/linux/stat.h > > > > > @@ -127,7 +127,10 @@ struct statx { > > > > > ????? __u32??? stx_dio_mem_align;??? /* Memory buffer alignment > > > > > for direct I/O */ > > > > > ????? __u32??? stx_dio_offset_align;??? /* File offset alignment > > > > > for direct I/O */ > > > > > ????? /* 0xa0 */ > > > > > -??? __u64??? __spare3[12];??? /* Spare space for future expansion */ > > > > > +??? __u32??? stx_atomic_write_unit_max; > > > > > +??? __u32??? stx_atomic_write_unit_min; > > > > > > > > Maybe min first and then max?? That seems a bit more natural, and a > > > > lot of the > > > > code you've written handle them in that order. > > > > ok, I think it's fine to reorder > > > > > > > > > > > +#define STATX_ATTR_WRITE_ATOMIC??????? 0x00400000 /* File > > > > > supports atomic write operations */ > > > > > > > > How would this differ from stx_atomic_write_unit_min != 0? > > > > Yeah, I suppose that we can just not set this for the case of > > stx_atomic_write_unit_min == 0. > > Please use the STATX_ATTR_WRITE_ATOMIC flag to indicate that the > filesystem, file and underlying device support atomic writes when > the values are non-zero. The whole point of the attribute mask is > that the caller can check the mask for supported functionality > without having to read every field in the statx structure to > determine if the functionality it wants is present. ^^ Seconding what Dave said. --D > -Dave. > -- > Dave Chinner > david@fromorbit.com