Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp749635lqg; Fri, 1 Mar 2024 23:43:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX3yWtjglwWrafguaM4pnemJBOvC4NTtduVEqpg846eKSGC+1Kbbq97MofaOMwjibVekb9yDLJyEPyehNDs22X+/PWBSuooUXdl0/fCpw== X-Google-Smtp-Source: AGHT+IHA2goT779r8dieT7O3zIUAMwkQY3QlVAF/c159PJyutKgaKRtr/n4Bm74BAR7BNZl+AEHs X-Received: by 2002:a17:906:3c13:b0:a44:2563:c5dd with SMTP id h19-20020a1709063c1300b00a442563c5ddmr2501081ejg.45.1709365399439; Fri, 01 Mar 2024 23:43:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709365399; cv=pass; d=google.com; s=arc-20160816; b=zpytj1itCExZgGqjYrd21rAymhncLvrw+8Rs8w1uJzMjF1Tg2cExevSuY5wAa1lPuA DIRRUR7VGndct5bXwMIggaC0+RY7GOibV8ggnBAKKFwpmfdNnJc79NS0aWOupgaYLf4p YplO7b6/8i21T6r0lqAusvtidQS3QcfK16or25kj6w9ChLiFoCjF+fSbhbYa0ys+g1o5 0RW30u3WV3fTL1pktkeRPJ6KMk+WDr1xA5bLKm4TZh29TglLblVIQxa8xI9ri676zfti bwc9mOjL7eKJioaxj5y1pyHUBPvcYNbnTHZAF8+x0BD97MzuPE3NAnGA+MNpSaJ4rYMg YZvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Pc6WGO5vTk7t7wqxhEwSHshxa9m7UoB9H431spDMix0=; fh=49J/Zt0xlnwm0YmOeJR9zjrKn5j1z3jj+50E8z95sYo=; b=h2k/xMdAx37Gh6Wcd7ee5+7Y2+0rUQzwVTymcARL+AS9pfKj2eyseLKqdGs5PbyPdP tAhCCy3d6hCVwyLz5QJvPVtQU8ivZ8ehAjRJRCP5Xz+slsZsQSmUwvLTC89vcoAwC9Tx 0taSXVjbLu27d7dMrW+0QUtRIVAOEKC7a5a7qFE1lh5/G2RcDNM3HPReh8DV/87+GmVF 5+wD2lK7BFVBo/jDZyt8NQDULaNE1/1a0ucNJEzoypLqIt7PWp5p6SEnfmSpz4h8Yugh XGBH4hRmHKFuQB85PaQWBUkivmWu+33mVaruS59BP+JDnXvZabDK1bxh8gf+3yDk58GG v/nQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kD8QL9ug; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-1467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u10-20020a17090657ca00b00a449529159bsi1076529ejr.709.2024.03.01.23.43.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 23:43:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=kD8QL9ug; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-ext4+bounces-1467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 289B01F2324A for ; Sat, 2 Mar 2024 07:43:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0B1917566; Sat, 2 Mar 2024 07:42:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kD8QL9ug" X-Original-To: linux-ext4@vger.kernel.org Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE9F715EB0; Sat, 2 Mar 2024 07:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709365355; cv=none; b=YY9+LSYBvEw0BMtOliP0hm6dbwSUuMKd0ju4W0kk4glIvJRjl3iMNO9UM0gUGmNWU7edBuRXX+aYeVjR/teEQLg7t2Mj/i87EWSUU9DnRvH64MbuzsOKYr2JZ6kJvhh9APdBQT2aHFk+AuN6dmfNATok4++0vaOYHnb1EaR7NQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709365355; c=relaxed/simple; bh=LIpOUewW6H0QEPuqhwnEO0ogdkFsfUKAZVbggnMfLIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HNGfyJRCy2n/TMnZY+SAvdl+Z4wzb0D2peGV9cz6D3Aqv1FlhVLiIEmrKiROaate7SxCWWlMs+0Fw8KgBNp756ZUXNVe8JXMDfNl4stXKbAfmCayy2jgyiRacEcC9TsJatMivKr+zeND1tgF21L4EZbXDa2hfX5syYG2eDmrazs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kD8QL9ug; arc=none smtp.client-ip=209.85.166.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7c835cfbff3so10486139f.2; Fri, 01 Mar 2024 23:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709365352; x=1709970152; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pc6WGO5vTk7t7wqxhEwSHshxa9m7UoB9H431spDMix0=; b=kD8QL9ugqah003AJOzkxPUuA9R16erVsMI6GV09V4W53uCTtFXpGn2y+YZx/C692Q0 aztE4YT9Hny264bjY+hYWvE66oSdy9S3z272Tb2SAW9JRA29cuN1WTMkBrVdGGBJCrFW dEZjB64N9SR11aRgDowJZ+5mHXwQVPyKCaD6DbLbBL0pGUZero2woOEeH5XYPs0QYGk7 ZvHqbVI3eu6TB5n1rvNfTI5SzJqLTCLJYLV0221oBaGUOO0YYECOmHwMkj+9gYBjcd9r XsF3Gl+VLn5jw1g83Q/KoOk2uDlWrzruCXiqUTEJK+C1xdNaHCGc13hKwt39wYyu7qd8 Geaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709365352; x=1709970152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pc6WGO5vTk7t7wqxhEwSHshxa9m7UoB9H431spDMix0=; b=aNyWq4gEioBNZ4cIWWPngvJVQsgecVqIa+5SnQr1HgIZ20f5PdUB/rTkMUpQqKNPll gWPWnspSgfP66I8bcaY+Hygk3vxvc9KxW/nFOGMi0dE5pYrVJxjVhziSY18Wf/R0Jzpe ySkSicOuXS4gLq2Tt2jLNBnrLRZ/KLAYMPq7Nnt99lLALdm2tUbYYTwz5+rQF7UNzKl7 B7jCEpGqOWpEZSrVXCxeLCoYTj3pRoQMOp4GCVYaFCaw3vL4IQaq/Ya+cuCVs27MsU8Y M7SkVZdbiyY4QCJ9yMwCoKv8eoLL6UIrlCI/1MzgzHmiSe/JHGMHDWac7FCa6iF9gunB CnHg== X-Forwarded-Encrypted: i=1; AJvYcCU3dcVghzu+BXhSZDqzB2V4xUfo5imKUvPIiS4+Rc6yEGb+ikXAdE7oQTbY7T4TDjXAdRaUGOD4JKW4l70qs4fcwlV3ROopBIQ7bSvf/4kJLqbnQNqxSPRUk9OVuOxYq/XnEIGKQbO7yg== X-Gm-Message-State: AOJu0YzV9SRgaVrmS0mfisUUa04HI4xNIsipkr/V0i9JpPhoabTEuU4b rFwrpgD6anZQHLlx9o4VzfKXKr2gdXsNeB7CDGBidwmxQYmtR42zfHIig/lP X-Received: by 2002:a05:6e02:218d:b0:365:259b:711e with SMTP id j13-20020a056e02218d00b00365259b711emr4972467ila.5.1709365352534; Fri, 01 Mar 2024 23:42:32 -0800 (PST) Received: from dw-tp.. ([49.205.218.89]) by smtp.gmail.com with ESMTPSA id x11-20020aa784cb000000b006e45c5d7720sm4138206pfn.93.2024.03.01.23.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 23:42:31 -0800 (PST) From: "Ritesh Harjani (IBM)" To: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Cc: Ojaswin Mujoo , Jan Kara , Theodore Ts'o , Matthew Wilcox , "Darrick J . Wong" , Luis Chamberlain , John Garry , linux-kernel@vger.kernel.org, "Ritesh Harjani (IBM)" Subject: [RFC 2/8] fs: Reserve inode flag FS_ATOMICWRITES_FL for atomic writes Date: Sat, 2 Mar 2024 13:11:59 +0530 Message-ID: <4c687c1c5322b4eaf0bb173f0b5d58b38fdaa847.1709361537.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <555cc3e262efa77ee5648196362f415a1efc018d.1709361537.git.ritesh.list@gmail.com> References: <555cc3e262efa77ee5648196362f415a1efc018d.1709361537.git.ritesh.list@gmail.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This reserves FS_ATOMICWRITES_FL for flags and adds support in fileattr to support atomic writes flag & xflag needed for ext4 and xfs. Co-developed-by: Ojaswin Mujoo Signed-off-by: Ojaswin Mujoo Signed-off-by: Ritesh Harjani (IBM) --- fs/ioctl.c | 4 ++++ include/linux/fileattr.h | 4 ++-- include/uapi/linux/fs.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/ioctl.c b/fs/ioctl.c index 76cf22ac97d7..e0f7fae4777e 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -481,6 +481,8 @@ void fileattr_fill_xflags(struct fileattr *fa, u32 xflags) fa->flags |= FS_DAX_FL; if (fa->fsx_xflags & FS_XFLAG_PROJINHERIT) fa->flags |= FS_PROJINHERIT_FL; + if (fa->fsx_xflags & FS_XFLAG_ATOMICWRITES) + fa->flags |= FS_ATOMICWRITES_FL; } EXPORT_SYMBOL(fileattr_fill_xflags); @@ -511,6 +513,8 @@ void fileattr_fill_flags(struct fileattr *fa, u32 flags) fa->fsx_xflags |= FS_XFLAG_DAX; if (fa->flags & FS_PROJINHERIT_FL) fa->fsx_xflags |= FS_XFLAG_PROJINHERIT; + if (fa->flags & FS_ATOMICWRITES_FL) + fa->fsx_xflags |= FS_XFLAG_ATOMICWRITES; } EXPORT_SYMBOL(fileattr_fill_flags); diff --git a/include/linux/fileattr.h b/include/linux/fileattr.h index 47c05a9851d0..ae9329afa46b 100644 --- a/include/linux/fileattr.h +++ b/include/linux/fileattr.h @@ -7,12 +7,12 @@ #define FS_COMMON_FL \ (FS_SYNC_FL | FS_IMMUTABLE_FL | FS_APPEND_FL | \ FS_NODUMP_FL | FS_NOATIME_FL | FS_DAX_FL | \ - FS_PROJINHERIT_FL) + FS_PROJINHERIT_FL | FS_ATOMICWRITES_FL) #define FS_XFLAG_COMMON \ (FS_XFLAG_SYNC | FS_XFLAG_IMMUTABLE | FS_XFLAG_APPEND | \ FS_XFLAG_NODUMP | FS_XFLAG_NOATIME | FS_XFLAG_DAX | \ - FS_XFLAG_PROJINHERIT) + FS_XFLAG_PROJINHERIT | FS_XFLAG_ATOMICWRITES) /* * Merged interface for miscellaneous file attributes. 'flags' originates from diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index b5b4e1db9576..17f52530f9c8 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -264,6 +264,7 @@ struct fsxattr { #define FS_EA_INODE_FL 0x00200000 /* Inode used for large EA */ #define FS_EOFBLOCKS_FL 0x00400000 /* Reserved for ext4 */ #define FS_NOCOW_FL 0x00800000 /* Do not cow file */ +#define FS_ATOMICWRITES_FL 0x01000000 /* Inode supports atomic writes */ #define FS_DAX_FL 0x02000000 /* Inode is DAX */ #define FS_INLINE_DATA_FL 0x10000000 /* Reserved for ext4 */ #define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ -- 2.43.0