Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp805709rdb; Sun, 1 Oct 2023 06:23:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHe0iDNPrHWSTCPbo2DpYCLdEY86DkIRmc5XqWxL2tADhB72em+wo3gUEMY1XM7t5itVVgI X-Received: by 2002:a05:6e02:1c05:b0:34f:67da:3d98 with SMTP id l5-20020a056e021c0500b0034f67da3d98mr12785333ilh.20.1696166633154; Sun, 01 Oct 2023 06:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696166633; cv=none; d=google.com; s=arc-20160816; b=UHQCVeX7ptHwIN4PaBHQx/WdYIaj8Rt5PsZzbLNiloSAOzcxOVrN84bB5RtESW9DKd wpF7preePN4PU6W5qcBHQ2N5X38EiTW6wnT8GBWkGDpFifbRTxRLhdUvQj1skbdf84Lt 1hvPHbuf5soxgaaUwK5O/OhZOxqYuSkjMr52JyDhGG77a0lufS4WCi02+SL2nJtsYRJX ZUkkuiQbHDK4b1j9GInoBs5V4ROtOzIZFXhXAEsQmUGlL7uBVoNOv9YPSUNxdHYn2Do1 5bs35ts/LDhAxw4m8kMrF3s+tmDLh4XegQ7b4RbDBv4TxWOacGLaHiGr2j3CdFrSRVlX CQmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=xVJSYZtpL0YLa+wcSpHtc+qG+rdtMGRB99f0WwrMd40=; fh=pJYCYutac7SNnZkoS8gNZhx3BljBaauFToOE7wRATzE=; b=DX8Ap25/lp8MDc+Lrn3uI2AMHFdZk8mz/c3nisKesvXLfqLEiaVDm2DItLGQo4TSxc uWDlwzI/Upg5rbg/SY/vKpN5KA6nIuanWFUZ3ONZzOaEdcFhkZvj8Vszs4A5h8VaGgbg TEyrDW3rGVItLtk07MC2H7VUduZWkUc1d3WWxuhnHmhI/M+qtUfN/R4o1ZujdDIvigZu t9uxv/7M/7FaKOP1Jn3pRa4MG5J9PZl8m/JxgCLdHrWGoVd/A/hw9MZtiPgzJRoSU3F8 /TawSXd9MFTZz7cPJXs22Xz77t+xIzg/o1g5osY8o05bR7fCCzvkbtzqD5razn6Tg+Ze wgOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b13-20020a63d80d000000b005777c70ebfbsi13542177pgh.612.2023.10.01.06.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 06:23:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A74EA8135624; Sun, 1 Oct 2023 06:23:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235007AbjJANXj (ORCPT + 99 others); Sun, 1 Oct 2023 09:23:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234979AbjJANXi (ORCPT ); Sun, 1 Oct 2023 09:23:38 -0400 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70CAE8E; Sun, 1 Oct 2023 06:23:36 -0700 (PDT) Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3af609c4dfeso2944548b6e.1; Sun, 01 Oct 2023 06:23:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696166615; x=1696771415; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xVJSYZtpL0YLa+wcSpHtc+qG+rdtMGRB99f0WwrMd40=; b=l8gK/xLbmU3VcpswqtVQ4osnKA3PiOgCmngkGdgGvW42lc3FPAoee0wkwEUE/i9hR3 9a9Fj0T9jBo1x9YS3TJ/62OSIqjzO9Z617M0bHZw21IUwRAuTp5qty0WKg1zgxz8+u04 eUV5mdQc3Tn/HrZzM7p1qYk38OeI1Lcqmwrfc2QJzy1Y0hVXjoT7GfR1wG9JpQTga1cH nfpzAcj7gk7kWmRMLiF8Fr2Vd5EQUSt6W/3RSJ8VggbtOtZL7aa+1RKwmJeX3r+qFALy OIZa1enx/FJueIi4Arsdy7hTPBm2grlt3kIqwQpFYVy5Z20RisCoEDM/hrodMBmd8WtU YmzA== X-Gm-Message-State: AOJu0YwlZR5/xURFcSL7Sps60/xL7XfhhisCqbdIr+UnD22ISDmGGjHV UAbFcBBFdrd+UxnV+7EYGgY= X-Received: by 2002:aca:220e:0:b0:3a1:bfda:c6d2 with SMTP id b14-20020aca220e000000b003a1bfdac6d2mr9142795oic.11.1696166615513; Sun, 01 Oct 2023 06:23:35 -0700 (PDT) Received: from ?IPV6:2601:647:4d7e:54f3:667:4981:ffa1:7be1? ([2601:647:4d7e:54f3:667:4981:ffa1:7be1]) by smtp.gmail.com with ESMTPSA id d4-20020a170903230400b001c20c608373sm20148814plh.296.2023.10.01.06.23.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Oct 2023 06:23:34 -0700 (PDT) Message-ID: Date: Sun, 1 Oct 2023 06:23:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/21] fs/bdev: Add atomic write support info to statx Content-Language: en-US To: Eric Biggers , John Garry Cc: 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 References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-4-john.g.garry@oracle.com> <20230929224922.GB11839@google.com> From: Bart Van Assche In-Reply-To: <20230929224922.GB11839@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 agentk.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 (agentk.vger.email [0.0.0.0]); Sun, 01 Oct 2023 06:23:50 -0700 (PDT) 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. > >> +#define STATX_ATTR_WRITE_ATOMIC 0x00400000 /* File supports atomic write operations */ > > How would this differ from stx_atomic_write_unit_min != 0? Is it even possible that stx_atomic_write_unit_min == 0? My understanding is that all Linux filesystems rely on the assumption that writing a single logical block either succeeds or does not happen, even if a power failure occurs between writing and reading a logical block. Thanks, Bart.