Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp53334rdh; Tue, 13 Feb 2024 09:08:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVFZaW8SIJRu85OvD1K043Ike51jNURLttGXXz38Z3HS2UgkOA1eNZp5gsdYxvSSADJvyCGQiT2zgwVvlPk/D8uRSGVcI5Q5A7AvAc6Hg== X-Google-Smtp-Source: AGHT+IGc+RR0H1tK9hBFm7zZyofk9zV0RokXxVEDIsk283ayOEDfrKcgAkFn+HUAzK88XUbP6oVJ X-Received: by 2002:a05:6512:238a:b0:511:69bf:d1f7 with SMTP id c10-20020a056512238a00b0051169bfd1f7mr119718lfv.50.1707844109019; Tue, 13 Feb 2024 09:08:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707844108; cv=pass; d=google.com; s=arc-20160816; b=jEwUsIYHhPzizbT/WSGxqeykDEWj7GQ9oTXRAHyKN5UBe5Vzty2B0nQmeXLZpmBaPH i/5mFrshw9ozce5x/7UoMQFEoVT8qxulYQzLqTPRzRBjhT8qFvG2wENG27qU/jsmgfuw PapNMzyvqa7bCaMlMa3EET2eWKP2T4QJCQAxFmR0ClJgxyuj0Cnd+f79SJByh3tObLAo HFVzLYn1mpB/o7SDlOLj9XwdPVksIEYf3h66vGbl3T6hiR42ViWDkEeOBl1QQMZgE15P 2u1urCzsW4HH8/3clXQlXxYGuTOctKuHzFc+0vUFH+XvsZNYGMzOYsPSVPhb5xtEyW8+ YstQ== 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=iCdL9nKMQMRkVLK9ZkCQ0EuaSGACzyS5s6R5wsi3w1Q=; fh=5f9xDU1GXqlu0F/oreok21JsRZ9k8K4GCh6ua1VYAJ4=; b=aJUVHoNbiQxied37nT+Y5mA12DsFsgVoAZs2BsGKEyT8GNyxGUrDxPRpAJPudPOT68 nLZ1WA23bOku5WD84YVqEEt50i4T9vhEAoxBckij5bJieSW/M99zNBz6Xaw9Ie/p/i35 86AWV2oRWbTILZ3mkucaan4ZXsGk8qtOu6DXvamP8TI/1N8DyBuf1vtIPqqXK2Cwv9++ 9j8/p+uZ3pU7Kpay3xR956nY+3MHby6TRqzMi+1HuEFXoTaUiomV1vywunrLBJdsyIoK hOelriaAbYAPb6ZubMMGOJC76285kGUtmYF7VnrUrnlh36GCf9Hv+RwpGXBmAD4XELAg XmsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iCCw0gWT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63964-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCU2rE5xc1zhd5G2sPtL/YDJ0I/VYDpDl5OhFVq6c2zCOLbw//PVt4rRLDILEGTiTlPQNQXuScgCxwc5B3cDD3Y9V/a5w65VyyJVOqX++Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g21-20020a50d5d5000000b0056156ce7a87si3835169edj.421.2024.02.13.09.08.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 09:08:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iCCw0gWT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63964-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63964-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BA4B51F25347 for ; Tue, 13 Feb 2024 17:08:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E787E5FF05; Tue, 13 Feb 2024 17:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iCCw0gWT" 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 121395FEEB; Tue, 13 Feb 2024 17:08:01 +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=1707844082; cv=none; b=P30IqzBYnM+IIx7gdLTgrsvPJto59fFtJNe4Y93BGvfs2Tc5VGS7oy5ly3QGvMSDDupHWfnhSroLum/tTk/o5zIRlwRPmgQVzhzWt1dkELktZWrQ00yaRxhOTGFZykAaVjU6G27SxDruVVMmLOdJvIPYbN+PZOisHs7u7DTbxGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707844082; c=relaxed/simple; bh=kMKt48JtyhnSZZmYJ+tvCCqJgAdUtaJZ3EdoLQoxG8s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NMtiFnmue5DkO4yzaapB7Oti3qvzrl2jDEBtgmriu5tyUOeOOYFsYhT7pHJ0lAkaJap+vl54vEsvw7BTH2LeBYd8Xl/8KS+EMN1wGz8aHCOqu5kUtuTRFT5YKgMeWj8oTKBoETYf0Qz+baJbVpx3kgMiaB6OD6j6tgBIo0CDwD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iCCw0gWT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72026C433F1; Tue, 13 Feb 2024 17:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707844081; bh=kMKt48JtyhnSZZmYJ+tvCCqJgAdUtaJZ3EdoLQoxG8s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iCCw0gWTjAL16cZFq1cKkWv34iqARLorO+GqyHVEmPmfKRM7IFt5RlIGulxSTJX+L vNAsup03pZfjMdBvoSGqmT7lhjtiX0dIkIoCVZ/QdTvWUB7CyXztNE7xrPenIuZC6S +mRelsv033/oQl+98xqRrieXD3LkrMFIzlupPKBoHc1mG4B43fxU/bwRod84hDaQvx hi1BbVvZRog4Da8V5cnnokfX2mBhuNf737SUxr/QXftnZviTv+4b5bQzS2aWu0BZ5G TceR8R12VIk/+VS0N+j5eE0IohF+orI9ueQmDxwFzzKDVE4/J6VFemmWD9qRSMCSIW JI3ze1A+iHe7A== Date: Tue, 13 Feb 2024 09:08:00 -0800 From: "Darrick J. Wong" To: John Garry Cc: hch@lst.de, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, jack@suse.cz, chandan.babu@oracle.com, martin.petersen@oracle.com, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, ojaswin@linux.ibm.com Subject: Re: [PATCH 2/6] fs: Add FS_XFLAG_ATOMICWRITES flag Message-ID: <20240213170800.GZ6184@frogsfrogsfrogs> References: <20240124142645.9334-1-john.g.garry@oracle.com> <20240124142645.9334-3-john.g.garry@oracle.com> <20240202175701.GI6184@frogsfrogsfrogs> <28399201-e99f-4b03-b2c0-b66cc0d21ce6@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: <28399201-e99f-4b03-b2c0-b66cc0d21ce6@oracle.com> On Mon, Feb 05, 2024 at 12:58:30PM +0000, John Garry wrote: > On 02/02/2024 17:57, Darrick J. Wong wrote: > > On Wed, Jan 24, 2024 at 02:26:41PM +0000, John Garry wrote: > > > Add a flag indicating that a regular file is enabled for atomic writes. > > > > This is a file attribute that mirrors an ondisk inode flag. Actual > > support for untorn file writes (for now) depends on both the iflag and > > the underlying storage devices, which we can only really check at statx > > and pwrite time. This is the same story as FS_XFLAG_DAX, which signals > > to the fs that we should try to enable the fsdax IO path on the file > > (instead of the regular page cache), but applications have to query > > STAT_ATTR_DAX to find out if they really got that IO path. > > To be clear, are you suggesting to add this info to the commit message? That and a S_ATOMICW flag for the inode that triggers the proposed STAT_ATTR_ATOMICWRITES flag. > > "try to enable atomic writes", perhaps? > > > (and the comment for FS_XFLAG_DAX ought to read "try to use DAX for IO") > > To me that sounds like "try to use DAX for IO, and, if not possible, fall > back on some other method" - is that reality of what that flag does? As hch said, yes. --D > Thanks, > John > > > > > --D > > > > > > > > Signed-off-by: John Garry > > > --- > > > include/uapi/linux/fs.h | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h > > > index a0975ae81e64..b5b4e1db9576 100644 > > > --- a/include/uapi/linux/fs.h > > > +++ b/include/uapi/linux/fs.h > > > @@ -140,6 +140,7 @@ struct fsxattr { > > > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > > > #define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > > > #define FS_XFLAG_COWEXTSIZE 0x00010000 /* CoW extent size allocator hint */ > > > +#define FS_XFLAG_ATOMICWRITES 0x00020000 /* atomic writes enabled */ > > > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > > /* the read-only stuff doesn't really belong here, but any other place is > > > -- > > > 2.31.1 > > > > > > > >