Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2171252rdb; Tue, 3 Oct 2023 12:26:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDRXalHVTh6srFV0+75TazB7o3NDG+/MUsfD6eV/PAJMvImY3tpwBE3lxf3EaEAZl05U81 X-Received: by 2002:a05:6870:fb93:b0:1be:f46d:a26c with SMTP id kv19-20020a056870fb9300b001bef46da26cmr558255oab.27.1696361178362; Tue, 03 Oct 2023 12:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696361178; cv=none; d=google.com; s=arc-20160816; b=t0HQMyFUvkqMnrZtmBQRvPLy81Ezs7KTdJ+nDLFd+VMoOgS6+FD0zHLSAiYNhr+GpD COUbJ3/X6HPci5RG46JGnVE0Dq5+6bc1qtdWzT4oxrKjO/EaLgP7kQOkLFHAHlR0n1YC hLmkVLAImeYAQJ1qXdMhVK7vl/I7dXeHdKi//+YGdAZLpp8+L2ycA5mgq40rtC5+TQGJ x+q2qwSpvZHHvTnc/tREfDA5uYJ+zFX+1q61a4vhH57YCkjlWIwORC+/ICWGsDjm6Lig u8caAAJA7SDNczw/u1M5/GfLCapdz9mMkqno9a7xy1wUGTqevR83nsnjqqVA9GqxJ9N5 9+zw== 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=mvmeoMdGq/xr4jJD60T1ZLKABdnT8aFJPxFgwlDXHy0=; fh=cW16Y1m0OBLjHOwebEd29YbfkxhEtOD/YEo3DMHtKw8=; b=KEfjkIs0wDAXnBD3lqRApVARG2STvuRKtFH0TT7QdADbHiyrHJD0aKE8JG0iG0kFdZ WeRV/0CBCYdmP2LLtxkeWoeSgJsANmVQwARuRZQXH33Mv3z99+X8a6feb62QKkHHML/L YxM9oDPqLsTscy7EYCIY6dAzNjYa3erlWY/Ynd/Pr75+g8GpWzohJzs52WA+W3NbWORb RMN2KmAYWZZN+xD3szt4ib52p4wHsmysAWU3xYw9PsCH5JVZEEfX8Wiz4NpbmLX5kg5D YBZxG1DtxLFEsoNBPw4/Q5mGd8mmnixWueh0BYi+Q47trSWKHu4PgIAflm/a41AV8lMp D7dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e19-20020a656493000000b00578e5228c76si1971232pgv.505.2023.10.03.12.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 6FB4380D88CF; Tue, 3 Oct 2023 12:26:14 -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 S232282AbjJCT0J (ORCPT + 99 others); Tue, 3 Oct 2023 15:26:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbjJCT0H (ORCPT ); Tue, 3 Oct 2023 15:26:07 -0400 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00FEE93; Tue, 3 Oct 2023 12:26:01 -0700 (PDT) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1bf6ea270b2so10045475ad.0; Tue, 03 Oct 2023 12:26:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696361161; x=1696965961; 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=mvmeoMdGq/xr4jJD60T1ZLKABdnT8aFJPxFgwlDXHy0=; b=mPTFHmeHfkTU542x09DuxdgaxyqzqBazQT3gcJZOx9pKyNKTB2uvOR0fhR4uPeXrzX XI1avUcHlbnbGxKSDvBMm5Bh6LUIXCVzXSeUwgXTyu3xGxcfd4fHjTljBvP90935QLrr zJkUXpA/dS/RGh8Pz9/uuBfGnHX+O2eehT9OrCgjgSzuthKM9uPHMIP/r7g4f63ESXkZ CXQcB4tNmrvYEZFaTQXagPx7SO4W71VnzbvlLINurG70QAleVgrJkegAYK7yJjvecZY6 ENGvY6IlRj0J+KMtcpfeipz6VsnlQWknI58BTQtxxCtFYbsUlDjDw/swmagxREJ/ihGS juMA== X-Gm-Message-State: AOJu0YxH2iCpl+EuH6rxKHjm/+cXu+7aaB0XNkKZiANLr7Pn5eVz7CAt fckNQlw2anG/hHGJyjYp7Ks= X-Received: by 2002:a17:902:e847:b0:1bd:d92d:6b2 with SMTP id t7-20020a170902e84700b001bdd92d06b2mr579129plg.10.1696361161272; Tue, 03 Oct 2023 12:26:01 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:fc96:5ba7:a6f5:b187? ([2620:15c:211:201:fc96:5ba7:a6f5:b187]) by smtp.gmail.com with ESMTPSA id bg5-20020a1709028e8500b001c76891b1c9sm1981549plb.10.2023.10.03.12.25.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Oct 2023 12:26:00 -0700 (PDT) Message-ID: <9ba10b14-931b-42db-b7c2-e6f9aa95e477@acm.org> Date: Tue, 3 Oct 2023 12:25:58 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] readv.2: Document RWF_ATOMIC flag Content-Language: en-US To: John Garry , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: martin.petersen@oracle.com, djwong@kernel.org, david@fromorbit.com, himanshu.madhani@oracle.com References: <20230929093717.2972367-1-john.g.garry@oracle.com> <20230929093717.2972367-3-john.g.garry@oracle.com> From: Bart Van Assche In-Reply-To: <20230929093717.2972367-3-john.g.garry@oracle.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 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]); Tue, 03 Oct 2023 12:26:14 -0700 (PDT) On 9/29/23 02:37, John Garry wrote: > +.BR RWF_ATOMIC " (since Linux 6.7)" > +Allows block-based filesystems to indicate that write operations will be issued > +with torn-write protection. Torn-write protection means that for a power or any > +other hardware failure, all or none of the data from the write will be stored, > +but never a mix of old and new data. This flag is meaningful only for > +.BR pwritev2 (), > +and its effect applies only to the data range written by the system call. > +The total write length must be power-of-2 and must be sized between > +stx_atomic_write_unit_min and stx_atomic_write_unit_max, both inclusive. The > +write must be at a natural offset within the file with respect to the total > +write length. Torn-write protection only works with > +.B O_DIRECT > +flag, i.e. buffered writes are not supported. To guarantee consistency from > +the write between a file's in-core state with the storage device, It seems wrong to me to start the first sentence with "Allows". Atomic behavior should be mandatory if RWF_ATOMIC has been set. Additionally, shouldn't it be documented what value will be stored in errno if the atomic write has been rejected? Thanks, Bart.