From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795710710; b=pI1PNUpb2g2Kt21q8WfbCSpodeDQKD5907Z602H6lvUo7Glgzm6zpYvD5oXoCzDi/djp fyPg4FubyrULDRDg6edyWJXOLjY5onJ+1gn+HD+V8J2fIRrIuXOFS5uTf9oU75Yktyw7v klpav88IiJ0srn2MYuYUCMcjmqrbz1E6nNvi0E8KJmoyrOCCfqY93XpDoj9YYUU5jcg04 MjC58d080JEjfJ1SxJNURkXMyuZFY0Xt36eCwv/hrm1h6zN1v/avyTGAZOD6E8YU6WCJZ yzZezl8/J2OXqsYzpwOSUR6YAcxEm00ZFV28D74NCnaVWAng98s7KYIuNF8sb/MaZUA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795710710; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=6DGKGHZD1sWqO2WRSY4U0udOhpGKQXiV3WJqb4Fx1ZI=; b=u1ALguLxlVFRZj/+P53Z+O4F6Gi6ayPo6EI57laJWh7rQUvBNhW/XznQMBQyTT62Sh/u oqtNavUJfaemdHLCtzEg4GGuPGvKeDFGlEI0Ht0hGxXHS8hfeKkavrBBCrlO4sZTgjiGo /W7fZFmLmX2S991fFH+RCwCJcd9yK7ZbBqYluOjxAiVHHAQ6Pg0jJD4ocB/jq1EQJDCDi voubQo5NhqhWTpOUi3KYpXAGmzU8c7krJhZUXN4NtaL896gFfX708HW2rdGPuGvksOA/M Fykh3TW2Pp+68vnmhdqG/CqqHY73oKZHmw/F3ZZnUKCL77Qr+OxgzQ0VJSW0GCBWZMQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NgzesBph; arc=none smtp.remote-ip=209.85.128.45 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 085A4606A6A5 for ; Thu, 26 Nov 2026 16:31:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 085A4606A6A5 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=NgzesBph Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4bb72b44a97so61874005e9.0 for ; Thu, 26 Nov 2026 08:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795710708; x=1796315508; 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:content-type; bh=6DGKGHZD1sWqO2WRSY4U0udOhpGKQXiV3WJqb4Fx1ZI=; b=NgzesBpha5/UiuwtyApe4LBXa4J/ZEE9RKL51o52cHEQZvDJx1Io0LkMX9T4hggZMH yMa0nLXZDeXh3OTT5Dceu8BR+qdcmeSaC9RWK6GGdpgvq67OWwu0N8mw3xfC+ykgxBkA yEoRN9ICF95EXoJwq1ROoEh5ttxJozEqUgS4kFy2WgRT3O8gDHMMShxwnJZV/bfNq8gV 94Ff+uDAmyBMb5RFFUJa2wayxciw/19DqrWBprAc5PQ2xTH4mJm64KnLuI4iptKk72YS FGHpM0M/l0unSVUyE9VXt42T1xN0phYdlNSwj0GuBcjfL5tAcfYo3HAercHmLDLsdKJ/ INoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795710708; x=1796315508; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6DGKGHZD1sWqO2WRSY4U0udOhpGKQXiV3WJqb4Fx1ZI=; b=LtoaSXJtsMFrlKti2R2Hv6bp5llaqliRN3hZWV3I0t6tK4u84UZpuBQ6jZyTT5GxAy ze5W1srgj7tWz+GoM3l7BersqsTo3DRFvf144RWu1JA02rfheF5zVechPNgZQout0r+4 Rrdu8RauDjpIgCGO/uq9QlMC56HibWqOAfsyH62bHk78geqpBPSRsQ0DEh31DZpp0seN OtmrLTegY3rb1kD+TVvBy9UpzZUf00TLK8sVPx1GwvgYYv9SQiVItUtPQkfDyhNdHHJJ D0lIreiHU8rXD83kezWLu1j/Y4lgsAaCHBTnoLg/l1vh8kzEV7fjT7fzzczjRFpg4q6v 8rgQ== X-Forwarded-Encrypted: i=1; AL+hErGokaBw2kAPFVD97Y5mp0/ZDdhw77u2N39WKG0/tkpj3+094a64g5evwpd1mQ3KuLNcBYVPHvWjqcQ=@vger.kernel.org X-Gm-Message-State: APuU4Z8FYE3q/kbKJ+JbWIH7pE8sx7xxvXLI3hEC1ELj92Bt0a+Wzsfi eKkAj8AsyJ2cD2PABTzo54gQMIH/yiCIaJd67o/NMKRPs4qiIF02Ogt6 X-Gm-Gg: AZFdTZepGbk/WfItVQSryKcGvbOor4Lql1bbPc9flifYuGjRHsdPEG+YBgfAoCwVlqJ HRHt1frxGOHoIF5yPYGbxHLOKwKFnKhmeTJfKMyu3/6+1o2puGsQfCyCo8lq8/BuliNFDLMUguE jSNiK8Cw1VdkxP1cGzvcJEMVHiugI+yfW/jp7zPTW8LV7vR1+/4wV48EApwxpgLYlKsyAASGTdZ uUVCfrKAWU8khy7roopGLLMxEl5kza3vQZt5pMAY3m/ZYj67cmODKpu5XzATNxZXYI68BYQOeVI P0FPbcIOoh3ptvY6IX1tBrPZ9zDYqim2xcREHvsRCT1mjRmSP/wT8BEIYIRFSJBHn9492HhZcjp N/s10sKdOLvvQ4Dsa2KN+HR2Y2Otk9zJLzRMxPxCJ2WcmSrMZSVP43gtZcTOcSrptK/wgA0jie2 85s2NoccIICyyr9BYyz4qOdVVW+lbgk5kI/KBy0FmzT2SBPPteuvzk6xz7zZ3oPzjVPqUjKIZiO nsRlJ9zEkdRngrWEScntxYCNeGthI1lmCNCAJIZjIyiEDXlzt2/dZvRZGlCcbAAzrkTMz1Xd5N5 s4jrKCuC2JwflxDlSXaMZljD X-Received: by 2002:a05:600c:3b83:b0:4b7:6b96:e431 with SMTP id 5b1f17b1804b1-4bb88822242mr502582645e9.28.1795710708243; Thu, 26 Nov 2026 08:31:48 -0800 (PST) Received: from infinity ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb853a9846sm721964995e9.11.2026.11.26.08.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2026 08:31:47 -0800 (PST) From: koraynilay To: Namjae Jeon , Hyunchul Lee , Eric Biggers , "Theodore Y . Ts'o" , Jaegeuk Kim , Alexander Viro , Christian Brauner Cc: Chuck Lever , Jeff Layton , Jan Kara , Alexander Aring , "Darrick J . Wong" , Andrey Albershteyn , Amir Goldstein , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lauri Gates , Christoph Hellwig , Dave Chinner , linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs@lists.linux.dev, linux-nfs@vger.kernel.org, linux-api@vger.kernel.org, koraynilay Subject: [PATCH v2 2/4] fscrypt: update fscrypt_prepare_setflags() to use xflags Date: Thu, 26 Nov 2026 17:31:12 +0100 Message-ID: <20261126163114.403846-3-koray.fra@gmail.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261126163114.403846-1-koray.fra@gmail.com> References: <20261126163114.403846-1-koray.fra@gmail.com> X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update fscrypt_prepare_setflags() to use FS_XFLAG_* xflags instead of legacy FS_*_FL flags. Signed-off-by: koraynilay --- fs/crypto/hooks.c | 10 +++++----- fs/file_attr.c | 2 +- include/linux/fscrypt.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/crypto/hooks.c b/fs/crypto/hooks.c index 149498bdab94..52d6a33fc9e9 100644 --- a/fs/crypto/hooks.c +++ b/fs/crypto/hooks.c @@ -182,10 +182,10 @@ int __fscrypt_prepare_setattr(struct dentry *dentry, struct iattr *attr) EXPORT_SYMBOL_GPL(__fscrypt_prepare_setattr); /** - * fscrypt_prepare_setflags() - prepare to change flags with FS_IOC_SETFLAGS + * fscrypt_prepare_setflags() - prepare to change xflags * @inode: the inode on which flags are being changed - * @oldflags: the old flags - * @flags: the new flags + * @oldxflags: the old xflags + * @xflags: the new xflags * * The caller should be holding i_rwsem for write. * @@ -193,7 +193,7 @@ EXPORT_SYMBOL_GPL(__fscrypt_prepare_setattr); * another error occurs. */ int fscrypt_prepare_setflags(struct inode *inode, - unsigned int oldflags, unsigned int flags) + unsigned int oldxflags, unsigned int xflags) { struct fscrypt_inode_info *ci; struct fscrypt_master_key *mk; @@ -204,7 +204,7 @@ int fscrypt_prepare_setflags(struct inode *inode, * derive the secret key needed for the dirhash. This is only possible * if the directory uses a v2 encryption policy. */ - if (IS_ENCRYPTED(inode) && (flags & ~oldflags & FS_CASEFOLD_FL)) { + if (IS_ENCRYPTED(inode) && (xflags & ~oldxflags & FS_XFLAG_CASEFOLD)) { err = fscrypt_require_key(inode); if (err) return err; diff --git a/fs/file_attr.c b/fs/file_attr.c index 40d6518f1d8e..1687891c526c 100644 --- a/fs/file_attr.c +++ b/fs/file_attr.c @@ -195,7 +195,7 @@ static int fileattr_set_prepare(struct inode *inode, !capable(CAP_LINUX_IMMUTABLE)) return -EPERM; - err = fscrypt_prepare_setflags(inode, old_ma->flags, fa->flags); + err = fscrypt_prepare_setflags(inode, old_ma->fsx_xflags, fa->fsx_xflags); if (err) return err; diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index 28f2108e29f3..68d0983385d0 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -461,7 +461,7 @@ int fscrypt_prepare_lookup_partial(struct inode *dir, struct dentry *dentry); int __fscrypt_prepare_readdir(struct inode *dir); int __fscrypt_prepare_setattr(struct dentry *dentry, struct iattr *attr); int fscrypt_prepare_setflags(struct inode *inode, - unsigned int oldflags, unsigned int flags); + unsigned int oldxflags, unsigned int xflags); int fscrypt_prepare_symlink(struct inode *dir, const char *target, unsigned int len, unsigned int max_len, struct fscrypt_str *disk_link); @@ -784,8 +784,8 @@ static inline int __fscrypt_prepare_setattr(struct dentry *dentry, } static inline int fscrypt_prepare_setflags(struct inode *inode, - unsigned int oldflags, - unsigned int flags) + unsigned int oldxflags, + unsigned int xflags) { return 0; } -- 2.56.0