Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp991516rdb; Fri, 2 Feb 2024 09:59:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0OP58iigsTpG8Z4dglH6Goy7O88qhUtDD2AeNO44TmIGh1PevQiqBU9toKZWOHNG7Md99 X-Received: by 2002:a17:902:cec8:b0:1d9:732e:8fe6 with SMTP id d8-20020a170902cec800b001d9732e8fe6mr2564827plg.16.1706896765130; Fri, 02 Feb 2024 09:59:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706896765; cv=pass; d=google.com; s=arc-20160816; b=p+Dyx3QeuWkiQxiypCnBDCJVUzka/81aBz3TQfVGTfzUuQs5yC6ybsQlNqdBOlMHJl SZp0LCbgQjzw6QMntEDOfVGYPBMuKKRRfqgJUzg9uM/st5nxNqFJFB+nKiO1QyXrZj1S QC5etT9V/FoOtkiePQjK3mOLiA5kXo78zoGlPfAp2NIyFVWcW58aHMkxBQH4h0idmSpn 2x5H44AivM/fdBo2XX3W/+c5hfOhtZxZm2q5zFMYA0UFs3SuWz2TLjetU178vJkk88z/ EL8mtl2WgJpp1VhvekavhlcN5Sih4R25QPyG8Gadlzczuq4gMD90foKF5WeHoUwEz3IY WBPw== 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=ZKG+EvAtWhewan8YTRcnXAEmeONCIQerBabi/78NrlQ=; fh=/70qlqRCK7WJi5l8h4NkusxL1Wixc3SheexafozrapQ=; b=EXzvygh3mMzhInZJ98tcIo1sAJbrmfDOqwHBF3OS69IYNtfvhtuwvneJcDQAyMENiu G9N6drBXnrElt52YDCfiI5dyjDV6brvHvrapfDuRrFZkc8rxn9Kdi1vcBtDQHhkQcra+ z3MSFdbYUKLcTfJN14RP6KM/sie9+eCL66xrjpjS+gpDLg9139PCXcI80k9ft95rp9P8 lZIZLApb7lVU+2aP79CE3QGuO488vc/80DDDoFUJeqqRP/EnZWaU8J7VPeaIwS8ZPQbx DFQk6rHj6O6P9EO+KNHs86J6t1uKCV62NZXh4lsibrrXYvDxgy89BqPIR46DQbWeabpF DBMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QFdxQU1F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWji39qc9ogI/qrV0osBm1Hjtcfs5cFDbXfXNya0ioX+gfSI23XZV9eQ6ADNiFu43mwM9xL8OmrUGAwOvvb6e4aON6pec6EdS7gJgNCvw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x8-20020a170902a38800b001d8ff334318si2085030pla.176.2024.02.02.09.59.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:59:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QFdxQU1F; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50278-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 6418628C3F1 for ; Fri, 2 Feb 2024 17:58:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C7A814E2CC; Fri, 2 Feb 2024 17:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QFdxQU1F" 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 8A19314A4E6; Fri, 2 Feb 2024 17:57:02 +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=1706896622; cv=none; b=J8AgLdqIY8c6hSwXDZ5OpmbLONgMBuJurAmeSLc1sKfBhMj1ZmZU03bzcxI7vwdHWY+l3WMWFRkepZML9INWZBDBxyLiSNrW5a2C6H+/LPbRi9BuLm3+pJy9MXwoD5stpe5Cq71KeKRgZmMtxGaOyIE5ChOwcniaETqXPzNSn+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706896622; c=relaxed/simple; bh=YDwuxmOU5GedLso/AjAPu0UEHBl8mlloHEaWlojo/uY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rtkv5FtPU1NsB7vaC0ZCJ2eT+0GVXTpS7e2nyY+LJFCZ85pkT8PJ2/gLPn9502X6XAEDT0lorT7lApXHbMzCGtGSb1QJa1l+EPoSrv2dlWDPz5FXFw1a7mpb4mTBXQ1ap4xIXqbKGSWRmH0RInpZ0vzeEcPpe4RwwI3Coj9SdYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QFdxQU1F; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03C2DC433F1; Fri, 2 Feb 2024 17:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706896622; bh=YDwuxmOU5GedLso/AjAPu0UEHBl8mlloHEaWlojo/uY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QFdxQU1FH8KyVVWxKSgZjhHNqrIJbTWk5njPHRuI5GceUCCon4DSj1SXkTkv4W7y3 KRWwi4djmiEcEXT9sxULrl1uBlQqmGPU5iId3D3OQEeB9cdudA4OA/tusM5768a0U1 71p7QCflBksGSLi9oM9iZSLogJWUvE1MC8JOpxlHyANFVXxZbc+YdRy8Zrkfk1q55u fa0xo7eAd41U+lmzcXxFEb7UvPa6Qc+RFXCm5JS9cJuy1d5+ghq+ojkofiqGHJUzIg jmoDf2kMaiHHaeN5V3kovdtNwkDbpMwClNO2ard0CNDYuPi7sEPSyf5Zs174xfLosB 9khLB7quPkWUQ== Date: Fri, 2 Feb 2024 09:57:01 -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: <20240202175701.GI6184@frogsfrogsfrogs> References: <20240124142645.9334-1-john.g.garry@oracle.com> <20240124142645.9334-3-john.g.garry@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: <20240124142645.9334-3-john.g.garry@oracle.com> 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. "try to enable atomic writes", perhaps? (and the comment for FS_XFLAG_DAX ought to read "try to use DAX for IO") --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 > >