Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1681658rdb; Mon, 2 Oct 2023 18:52:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUKpBEdtDY5EBwkM/dl068CK6WuiMi5zRti0U/v+KFqJ7Iidg1ex+leb4OplCGvuSJMlxc X-Received: by 2002:a17:90a:c685:b0:269:5adb:993 with SMTP id n5-20020a17090ac68500b002695adb0993mr9678392pjt.22.1696297928727; Mon, 02 Oct 2023 18:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696297928; cv=none; d=google.com; s=arc-20160816; b=P7igjDPR5Eyv8yKxkHV1z4d/9xmpxfIfKBy4UTxkVxzgvAvi0Nh/2oPqizvnTdorth SsSDBRfJSww5ory3XQRD0vogDfbuCEynPsp77IJ50uxn4SKnuzNIiDKXxEBku/mFZIy7 KdEaIpgscKsc6pbrDJT3bjGAFZTWEArfQp3ylJi0odz6TfApdaxYtuF3EnM2hf5NJsg/ cQsK8hfgL8BmKRo/jW65CbV65PQv/Yfy6CrRaKE3T0FKxDA/wk3PgjUoNytUDyBBZzQE ApzgzcPyDBAg9vZJfuhrPOlfj6qEiaKpThilPUDxAdOgpI2tAmnQCP8Dr8gh+sLRSRK0 iBwA== 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=ryilhvn2NwsqlzE716oXqoFx5LNv9PYSQOslNalU2W8=; fh=Qe4tYVcfxsv17UPxsQVnwOFVHq7+qbR++BK6bRh11J8=; b=kvGgGrKtX0x7NBZnXKZi9XVOV3nGBwif0uuoNNq1psTpIIBhzgsSK/zHRXfVN+iain HUcmrCqzJc/myDALZ9p0SoJPc4k6IICA0Tmd2I87yJdXDngnTDbj0GKmp4oF3qMAn1hp 8VjZgluO47FQwodFgK2BLx0ziWicuH8wqs32n1UAIXBfv4T3qAFCTRzie3d6rup4McSp fA7IajCOY2olRAD+NX4Mg/V4nLabDWO+9IN0TZgnWCzdiiaX9iCqf2R9gSmHVQ9GKgJS OzPnwGJ8Fb0/jXdU/QSqNlRhcqIbuxRjAt9U/9gi+HGUr9e7AhdZIQxu02QR7FHT5sw6 JfFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=AYLiTDKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fw20-20020a17090b129400b002683f507990si8668261pjb.109.2023.10.02.18.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 18:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=AYLiTDKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0FDAF8028F91; Mon, 2 Oct 2023 18:52:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238955AbjJCBv5 (ORCPT + 99 others); Mon, 2 Oct 2023 21:51:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbjJCBv4 (ORCPT ); Mon, 2 Oct 2023 21:51:56 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 788B5C9 for ; Mon, 2 Oct 2023 18:51:53 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-690bfd4f3ebso287674b3a.3 for ; Mon, 02 Oct 2023 18:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1696297913; x=1696902713; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ryilhvn2NwsqlzE716oXqoFx5LNv9PYSQOslNalU2W8=; b=AYLiTDKNuQs6w0myGbYLWykexKtd0cL2ILJCgbMyGqfi2E/AST3Ez76buB1Yg8vDeP JOPgT+faK6MMXOGsY0rsndMEEF6ofBIrizHO0xK2MRd2BkCTOsjVcyXb4O9dbsaWjS94 m6XTbReLg1xxPVKWz+zOgx1nG+UVfPSQnAkEf1oXj7xKcx5D5z6PWw186VXVWC64mSW3 5n5lzD3KfksLJBI/Jwy7CNc5XDQDD8nY5xJja7RXdfrb+7lkq1zvM7zHJjyczrT0U9pi 39YdfznnXMtbEReBZIie/SyIGERuto65oKDR5sQfhWKCKm2H/n+oPOYvKD8NV4fuGHbX ZHhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696297913; x=1696902713; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ryilhvn2NwsqlzE716oXqoFx5LNv9PYSQOslNalU2W8=; b=LTrNUHJKLdjoYLqlfLvmbPwLxPNWR7xNWmYiMv6s1TPrGCWcrOt5Bhf4LeER7G+Z/T Ew6w+Nm6N8H88OGm/wEw4p0p3T8O4h5KJIrrZjXt+4H2WkXLRdq/SuFgAqlWp42YGcK2 QvKpoYgTfFd1Uk0hM9b9EpDU2YUVVcg+Iu9c/LKqDmNNF3UQTx++j9h8Wyp86r3joSS1 zy1RWo72DzV9OITvblGA7X7BgtYIEE0S8HPWhqh9CYSEi/ttqvYIGXXGFYq9HcFq7Rh4 7dDbMlDdVQI+9Enkfpq61JHMsdE3PXlJBQFfS+kCFpgOJDWmSkiCmR+KBqNJ+hl7ZNDb tR+w== X-Gm-Message-State: AOJu0YzOBLXEGNXSPwOvPXmiyoX35CB6x+u/KHPh606b9pXFithfJE/d 7VfVgatgSYxLxohr7ZUfmXWUkpOUUNgfHECyEAA= X-Received: by 2002:a05:6a20:7f89:b0:14c:d5d8:9fed with SMTP id d9-20020a056a207f8900b0014cd5d89fedmr14193403pzj.54.1696297912959; Mon, 02 Oct 2023 18:51:52 -0700 (PDT) Received: from dread.disaster.area (pa49-180-20-59.pa.nsw.optusnet.com.au. [49.180.20.59]) by smtp.gmail.com with ESMTPSA id z17-20020aa785d1000000b00690c7552098sm154707pfn.44.2023.10.02.18.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 18:51:52 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1qnUZh-008huh-38; Tue, 03 Oct 2023 12:51:49 +1100 Date: Tue, 3 Oct 2023 12:51:49 +1100 From: Dave Chinner To: John Garry Cc: 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, djwong@kernel.org, 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: 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=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 02 Oct 2023 18:52:06 -0700 (PDT) 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. -Dave. -- Dave Chinner david@fromorbit.com