Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2761790rdb; Wed, 4 Oct 2023 10:34:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjhCoyLUZTOXAM/EbWrtiDCfOJox+hnnf4hopbIq1Tar3vRjjLS6l3kOIZGYKclYSH4XTj X-Received: by 2002:a05:6a00:1d0c:b0:68f:b986:ff69 with SMTP id a12-20020a056a001d0c00b0068fb986ff69mr358798pfx.6.1696440866268; Wed, 04 Oct 2023 10:34:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696440866; cv=none; d=google.com; s=arc-20160816; b=a5R7fUiiGjDqYtSEqS7iFNtyzN8yUNajusxmMNQONKWkXkt57x0PmXLQS1cMMcAONp BKUrDiAhKdmPmC2TcdegVbyC3tthne4cpkmS4o/MmrZzAV4U05CfDwMRVO4GpJuclDYZ S4fW9nFADMig1HkiPVkf4L8580JRmvhDYOs5YBTLAUW8lOhhfMefntd80EanArJIovOM a77YYx8J7C4hDQOMV5KXfZmABzmvrgLs37RJjF8L+UlMpDmDCR9XV0T2DwAR9+Cq0QRg SUFiu3rdeXIZiHWyJgmZYI8zm9I1EbkX0yjtcIhtNXd9Mt1XbwO9fz7TlVUU+m5UTtdE wUkA== 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=A+/9fMvIMylBk0tUbkGNvHwmLNtY7jK7qI7VPa1SYvo=; fh=We7zvi8mcHjAGJwWEk3OTtILBNFID+0I0AYuJbW3u7Q=; b=w9DfkEfBPPqxByWY0ydISSIKfswrDIeyYh5f9UrAYkUZIYIim0VyVE8ppLqM12zxZk 5b05ouopurG/XUna2OUaeU2Toss+Y0Xz/llX7yQ/kzeOE/xMMoqJUS6RyrS0r/6dhRoN zTxgyyarZ1sr0+1kOYxbAp7vl0jPrOQxcYAftEhJUPQ3NM4V9dSucb2LPEsHmSYjH+RO uzn44V8bxjkf7ckirn8SUEbHVmDTZ6QHXwfodnfW9LThzD1ZuCEdxsQccwBA44oKC+Nu ZVih8+lfAqdiCu6p718+pFjlSh92on/wK/Py78CViVlwKXD3+UFLX1Hv3jCnFpNLyCCu mI8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u28-20020a63b55c000000b00578a084850dsi4130902pgo.720.2023.10.04.10.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 2DBA7837439D; Wed, 4 Oct 2023 10:34:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243690AbjJDReW (ORCPT + 99 others); Wed, 4 Oct 2023 13:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233721AbjJDReU (ORCPT ); Wed, 4 Oct 2023 13:34:20 -0400 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA171A6; Wed, 4 Oct 2023 10:34:16 -0700 (PDT) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1c63164a2b6so9710405ad.0; Wed, 04 Oct 2023 10:34:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440856; x=1697045656; 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=A+/9fMvIMylBk0tUbkGNvHwmLNtY7jK7qI7VPa1SYvo=; b=kO0PWT5No7NlODxM63GhW7VUuyO89xEdHizAXlK+4KHh880crBurt3wcMndUKeqRTg cwFuIZum5VQ11J9iIRMGoyE7VBadrFVYbGHI5HFJ5jRwjg/1PSjuFVitxe6osjG424ES O1wo3WRSAr+hs0BGeakrA9EG/MOGp130rEEE7eraLidDqKBVK9PdZVBUlAPffJdtbwz3 r8W1MvCZ/XEZSdtBpRftKhaV7eMuW+IljlUYu4YWTuy+osXc1QhEuDD7Tvex9VoT6Tb/ yQj8TQlNY0w4eorwcS52ln4z57slUSuCM9yLZPKaaTUlMZCZrtBn515PscBtOgT2/ygR etvQ== X-Gm-Message-State: AOJu0YxPlAE8R6YCYS2Nczjmk9A+QQz3ns7qdgRqyhu+NbRBnyrrljz7 r4PAv4lK056Xh8yhOi1shRQ= X-Received: by 2002:a17:902:d4c4:b0:1c5:e207:836e with SMTP id o4-20020a170902d4c400b001c5e207836emr444422plg.26.1696440856149; Wed, 04 Oct 2023 10:34:16 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:969d:167a:787c:a6c7? ([2620:15c:211:201:969d:167a:787c:a6c7]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bbb25dd3a7sm3978166plr.187.2023.10.04.10.34.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Oct 2023 10:34:15 -0700 (PDT) Message-ID: Date: Wed, 4 Oct 2023 10:34:13 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 10/21] block: Add fops atomic write support Content-Language: en-US To: John Garry , 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 Cc: 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 References: <20230929102726.2985188-1-john.g.garry@oracle.com> <20230929102726.2985188-11-john.g.garry@oracle.com> <17ee1669-5830-4ead-888d-a6a4624b638a@acm.org> <5d26fa3b-ec34-bc39-ecfe-4616a04977ca@oracle.com> <1adeff8e-e2fe-7dc3-283e-4979f9bd6adc@oracle.com> <8e2f4aeb-e00e-453a-9658-b1c4ae352084@acm.org> From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:34:25 -0700 (PDT) On 10/4/23 02:14, John Garry wrote: > On 03/10/2023 17:45, Bart Van Assche wrote: >> On 10/3/23 01:37, John Garry wrote: >>> I don't think that is_power_of_2(write length) is specific to XFS. >> >> I think this is specific to XFS. Can you show me the F2FS code that >> restricts the length of an atomic write to a power of two? I haven't >> found it. The only power-of-two check that I found in F2FS is the >> following (maybe I overlooked something): >> >> $ git grep -nH is_power fs/f2fs >> fs/f2fs/super.c:3914:    if (!is_power_of_2(zone_sectors)) { > > Any usecases which we know of requires a power-of-2 block size. > > Do you know of a requirement for other sizes? Or are you concerned that > it is unnecessarily restrictive? > > We have to deal with HW features like atomic write boundary and FS > restrictions like extent and stripe alignment transparent, which are > almost always powers-of-2, so naturally we would want to work with > powers-of-2 for atomic write sizes. > > The power-of-2 stuff could be dropped if that is what people want. > However we still want to provide a set of rules to the user to make > those HW and FS features mentioned transparent to the user. Hi John, My concern is that the power-of-2 requirements are only needed for traditional filesystems and not for log-structured filesystems (BTRFS, F2FS, BCACHEFS). What I'd like to see is that each filesystem declares its atomic write requirements (in struct address_space_operations?) and that blkdev_atomic_write_valid() checks the filesystem-specific atomic write requirements. Thanks, Bart.