Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp857350rdd; Wed, 10 Jan 2024 01:19:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOAOx6oYNJ+xVxFvEl8GMfIhvwdhL/swjLWiH/KuszAs7dN1EwnKG0dKVSxfhAOdRptyxq X-Received: by 2002:a17:902:6b8c:b0:1cf:b4bb:9bdc with SMTP id p12-20020a1709026b8c00b001cfb4bb9bdcmr1027900plk.9.1704878391492; Wed, 10 Jan 2024 01:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704878391; cv=none; d=google.com; s=arc-20160816; b=H0XgPLKh9V+jC3vqiCDuph6vxek4QFQ0QaNLN/8M/ChVDWd6ZEU4zxpvRUgFmBMilA OZqer4I3kgV6w55AwWJTh9JyZoCWkkL+uyKf4hV87SrBkrF4qXpGqZGOhGA3rfOLoqED OfurFanpc+UNFunJxCtse/hrTrswEMzfHbfiTgetsnEGywoe7bE0IdH4Ysk+azZft38v 4HHT6yPJiPiPbqYvOQcElicmCGQelfHNZEb+wHWM5JfHIRnTD0dRroU5MANcJ+nhFdTK 7satpg4qgpSiToFjrduqZrSHZHJDhbRIhI3aQsFuyC5oC2BbmQVl17pgdZOZ5vrYptFL uV/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=IR6Ns2GlhxlVCEplPO+6+F5QlUAeUgDKJssWiKXQa0s=; fh=lHtWki+nY39lI3jAbE2FVHx9uI51ly83YBSC3gENdww=; b=DseSX55eKnCnxIdX+dMhSLup0SMBCyKKAcORVvRTHoE+xl1UBMuBUMNGasXJipbfrf IhpyaRYJpk3WQfnWcn4CF3vUeRgQRvw15aBbKYkz3p1OGe6e4L0cMdrBFVlqAKIjujw8 9+L92Bv9Q8TApiiEzUh/oLwA4AB2ugsD0UZXednYcYaNhdBmM6jRynXtFjcSF9EuPeeD g3/UUDaHEFOXwlf0MNktrDcsbL0ORVZi9BwbJAwuH+qX3LBgHm3KdBLzwctEp09tEkBY O69zNSocugfBBRDSrLpdjJ8kk9L80rP1YILGbVhP0/XWbtZVPQjDuiW7j5DSrZTaqSTX 6R4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-21893-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21893-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f9-20020a170902e98900b001d3f68ce021si3232386plb.501.2024.01.10.01.19.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 01:19:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21893-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-21893-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21893-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DC2AD284CC8 for ; Wed, 10 Jan 2024 09:19:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EABED3EA87; Wed, 10 Jan 2024 09:19:38 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B740320E; Wed, 10 Jan 2024 09:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 34B2368BFE; Wed, 10 Jan 2024 10:19:29 +0100 (CET) Date: Wed, 10 Jan 2024 10:19:29 +0100 From: Christoph Hellwig To: Dave Chinner Cc: John Garry , Christoph Hellwig , "Darrick J. Wong" , axboe@kernel.dk, kbusch@kernel.org, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jack@suse.cz, 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-scsi@vger.kernel.org, ming.lei@redhat.com, bvanassche@acm.org, ojaswin@linux.ibm.com Subject: Re: [PATCH v2 00/16] block atomic writes Message-ID: <20240110091929.GA31003@lst.de> References: <20231213154409.GA7724@lst.de> <20231219051456.GB3964019@frogsfrogsfrogs> <20231219052121.GA338@lst.de> <76c85021-dd9e-49e3-80e3-25a17c7ca455@oracle.com> <20231219151759.GA4468@lst.de> <20231221065031.GA25778@lst.de> <73d03703-6c57-424a-80ea-965e636c34d6@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Wed, Jan 10, 2024 at 10:04:00AM +1100, Dave Chinner wrote: > Hence history teaches us that we should be designing the API around > the generic filesystem function required (hard alignment of physical > extent allocation), not the specific use case that requires that > functionality. I disagree. The alignment requirement is an artefact of how you implement atomic writes. As the fs user I care that I can do atomic writes on a file and need to query how big the writes can be and what alignment is required. The forcealign feature is a sensible fs side implementation of that if using hardware based atomic writes with alignment requirements, but it is a really lousy userspace API. So with John's API proposal for XFS with hardware alignment based atomic writes we could still use force align. Requesting atomic writes for an inode will set the forcealign flag and the extent size hint, and after that it'll report atomic write capabilities. Roughly the same implementation, but not an API tied to an implementation detail.