Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp534254lqp; Wed, 12 Jun 2024 08:43:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXb7zZG36QzasCQNqJEf2oF3HPxmwHj5Zr+F2rH9eo3uJ11L4IgqFtJVrif687KnXBszrEwIiklOl4Ba7zx2XJ6FlYFT5CBRPjtYBdprA== X-Google-Smtp-Source: AGHT+IGqvq0rd2LUC+72IoOXfNYUy/aakY0aZ078GQhsCpImTNp9dxG87I4s/z2v68P0PjupfE3r X-Received: by 2002:a05:6a00:b43:b0:705:97b3:4605 with SMTP id d2e1a72fcca58-705bcef2b98mr2621965b3a.25.1718207038212; Wed, 12 Jun 2024 08:43:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718207038; cv=pass; d=google.com; s=arc-20160816; b=xBoBMgMOr18FCkdGoPbDXBtN9tNldEye3nFD2FPrfDx6eAhOYlMOb3ZANBDWGRsnbv ZxidOYkAaYvVIGysFEMayJ9Wj4JogmZv2hNevDxaOycogIzhZDFgxggQ8eKby/gduief XvE1iiuAb2OoTXmZKEDJOWrc3Wgf+UDGmGWfVfkTFs+PyMXvi+UjEvvtbNyGxzsBmG/S /5WaaoHcmZQFG9trPaHN3V9i0Uo2LNajGY3d93b9olZLHxnzC4YEBmDFOo/pzuiwF1r5 7Jpqn2XSPqDiaqis3GKgoyxrTfWGXrgWaJL9UOVsOA8WC3ySagRtOA8IAnUCjFbYUOca jn2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uOrcYKjvpT35wA+xF0tYekHbBaRzMR2LKXkUNST1BLY=; fh=+hggxFJ6BpxWQp2LJRwvwRQITXXsaPaOxbPE/6pMxz8=; b=tL0zmzg8WcBvcAZ0Uk5uqwAH5B2EdZu0JsbaCtDxcUkVmII7Z3dfNtDaY8ZCemy6bF n3nluQ7r1rE9dj2sSPoMwUlq8YR+moYpmCUfM2Rs3/noFxjz4J2Vt9Ildt/39ljOdpBY Vtxl3JCkTR0b8KgBERphnSPUIw8tbDVEB03pbK/g6+S5GE6Ksr3Ya1eGq2cHXFV9y8Ln LGU7q0gWy+4JyAM5yH86gOdzzYWlx8Y59kztZ8xByfnNPz2CUAjiIAgJuwsvBCbmrNeb xY6oob/JKqyecT/iuWed/e3GrPmVEc4EZsX4rv3RvCmMKQICzcZUrFpZcE/wiGEtRdg5 qEBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Usgv+C/e"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-211810-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 d2e1a72fcca58-7041b732474si8896306b3a.292.2024.06.12.08.43.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 08:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211810-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Usgv+C/e"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-211810-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 6F356281671 for ; Wed, 12 Jun 2024 15:43:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E7AF8180A82; Wed, 12 Jun 2024 15:43:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Usgv+C/e" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 148361802D7; Wed, 12 Jun 2024 15:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718207024; cv=none; b=gSbbVer5HOmpEuusFNkVfVYCUWMNPA5zzMgIyAXNsMPThYUp1mRxeK2qVjHik0PQqoNXjngfPxp8JtfVWWcc/Z92EkyuQh80fAg+bv55MG1UZlYL5OrWQnsm4eO3NIK6wD8YMEw4zC2Or76wnRvw0bxQsNyWL6miLbimYA3YU3s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718207024; c=relaxed/simple; bh=viWgeyD653r31MiLWhNh3LFZNvBZzTGpeJJoQhAvSz4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l+VMZEtQAaPUPcLfBPJnHW4Hm4sgPD3TcHXjIzrp2On4FgxOMVU+IbKA95yiyFlhobHtxzTtmIBsmC1VTFIxYUpNTSODA4HhHfq3HLIkET/7oj+MWbtO/fRaHIv/icd107FMesO7AiOTeV0KASAQPpJ5LMkmWGyqVUI8ua5VrW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Usgv+C/e; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84387C116B1; Wed, 12 Jun 2024 15:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718207023; bh=viWgeyD653r31MiLWhNh3LFZNvBZzTGpeJJoQhAvSz4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Usgv+C/eWKPNVB/O70oZtRo7hZ1YUmaavo22jrWBVrIBUr+0SA8gMhgwRRMtfBvLH ncSICA4si0AJgTjQoXpGrai5D/sZRz6pQCHJpYNWuas4ZclFuORK04RbVDobc+2/Iw 0Zz/bZuxg01mNo6ffpOtgrID37SxaPf2QIF39XOzWnE+Hk4sqC0HegVnNjo7TGl4Tc hrW8BT1zN5o1XZqmfFVmZUJa4O08515lRI035ztq0ZG7xgb6cybUHYQHgrt1EhLnm6 gZhqsBWH3qv5Q+Wj27xW5mXGiXcWIK3c/Y0ngyWiZeYzl1oCjjQ9msCs4NLUN7kSRX Nn2LXiCSfn9aw== Date: Wed, 12 Jun 2024 08:43:42 -0700 From: "Darrick J. Wong" To: John Garry Cc: Long Li , david@fromorbit.com, hch@lst.de, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, chandan.babu@oracle.com, willy@infradead.org, axboe@kernel.dk, martin.petersen@oracle.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, ojaswin@linux.ibm.com, ritesh.list@gmail.com, mcgrof@kernel.org, p.raghav@samsung.com, linux-xfs@vger.kernel.org, catherine.hoang@oracle.com Subject: Re: [PATCH v3 08/21] xfs: Introduce FORCEALIGN inode flag Message-ID: <20240612154342.GC2764752@frogsfrogsfrogs> References: <20240429174746.2132161-1-john.g.garry@oracle.com> <20240429174746.2132161-9-john.g.garry@oracle.com> <20240612021058.GA729527@ceph-admin> <82269717-ab49-4a02-aaad-e25a01f15768@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: <82269717-ab49-4a02-aaad-e25a01f15768@oracle.com> On Wed, Jun 12, 2024 at 07:55:31AM +0100, John Garry wrote: > On 12/06/2024 03:10, Long Li wrote: > > On Mon, Apr 29, 2024 at 05:47:33PM +0000, John Garry wrote: > > > From: "Darrick J. Wong" > > > > > > Add a new inode flag to require that all file data extent mappings must > > > be aligned (both the file offset range and the allocated space itself) > > > to the extent size hint. Having a separate COW extent size hint is no > > > longer allowed. > > > > > > The goal here is to enable sysadmins and users to mandate that all space > > > mappings in a file must have a startoff/blockcount that are aligned to > > > (say) a 2MB alignment and that the startblock/blockcount will follow the > > > same alignment. > > > > > > jpg: Enforce extsize is a power-of-2 and aligned with afgsize + stripe > > > alignment for forcealign > > > Signed-off-by: "Darrick J. Wong" > > > Co-developed-by: John Garry > > > Signed-off-by: John Garry > > > --- > > > fs/xfs/libxfs/xfs_format.h | 6 ++++- > > > fs/xfs/libxfs/xfs_inode_buf.c | 50 +++++++++++++++++++++++++++++++++++ > > > fs/xfs/libxfs/xfs_inode_buf.h | 3 +++ > > > fs/xfs/libxfs/xfs_sb.c | 2 ++ > > > fs/xfs/xfs_inode.c | 12 +++++++++ > > > fs/xfs/xfs_inode.h | 2 +- > > > fs/xfs/xfs_ioctl.c | 34 +++++++++++++++++++++++- > > > fs/xfs/xfs_mount.h | 2 ++ > > > fs/xfs/xfs_super.c | 4 +++ > > > include/uapi/linux/fs.h | 2 ++ > > > 10 files changed, 114 insertions(+), 3 deletions(-) > > > > > > diff --git a/fs/xfs/libxfs/xfs_format.h b/fs/xfs/libxfs/xfs_format.h > > > index 2b2f9050fbfb..4dd295b047f8 100644 > > > --- a/fs/xfs/libxfs/xfs_format.h > > > +++ b/fs/xfs/libxfs/xfs_format.h > > > @@ -353,6 +353,7 @@ xfs_sb_has_compat_feature( > > > #define XFS_SB_FEAT_RO_COMPAT_RMAPBT (1 << 1) /* reverse map btree */ > > > #define XFS_SB_FEAT_RO_COMPAT_REFLINK (1 << 2) /* reflinked files */ > > > #define XFS_SB_FEAT_RO_COMPAT_INOBTCNT (1 << 3) /* inobt block counts */ > > > +#define XFS_SB_FEAT_RO_COMPAT_FORCEALIGN (1 << 30) /* aligned file data extents */ > > Hi, John > > > > You know I've been using and testing your atomic writes patch series recently, > > and I'm particularly interested in the changes to the on-disk format. I noticed > > that XFS_SB_FEAT_RO_COMPAT_FORCEALIGN uses bit 30 instead of bit 4, which would > > be the next available bit in sequence. > > > > I'm wondering if using bit 30 is just a temporary solution to avoid conflicts, > > and if the plan is to eventually use bits sequentially, for example, using bit 4? > > I'm looking forward to your explanation. > > I really don't know. I'm looking through the history and it has been like > that this the start of my source control records. > > Maybe it was a copy-and-paste error from XFS_FEAT_FORCEALIGN, whose value > has changed since. > > Anyway, I'll ask a bit more internally, and I'll look to change to (1 << 4) > if ok. I tend to use upper bits for ondisk features that are still under development so that (a) there won't be collisions with other features getting merged and (b) after the feature I'm working on gets merged, any old fs images in my zoo will no longer mount. --D > Thanks, > John >