From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795976414; b=x1E8f3d89Tu2NnJ0pZvipHLy96ZM+lFMBf04Vbr0oCcd/IHTUWtiv4OKPsxqjdjctexl Xxlra+aKNJVW8i/6f2PEk8Sl44PwQNLXieLiuLRLmu7IsLbceaM7pDApB30IbGlXge/xK DiLFRXdXxDu20QKAbrXyJMswEep70j+zjLtIXaDTo6ZlljJn8z6XHbiP0fYzlsJ+Si7ZH 5OvsL+ZEi11+LHW82NTUfGyvSLMNDtls/wVuvfjMIO/aJwIGgHOoRwPpjKhcH9wMJ7xKY UfnWVnZb+kYnzO4JHCSf7lcCLja/VoZUieCLJBlJ312QcOmV+pzL5JlyFdh7XsKHitQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795976414; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc:X-Mailer: References:In-Reply-To; bh=ow0gh1mmdygv9Aa1zDYMwfVwIzWsW3h0z63AOxRo408=; b=i6xj4NZiS1i6ZXPa6Z/Q4nDYC+dd7YKMqTGS5UktCdulpK9y2sOfYHjai2XgP4OPbKjk yChP3dJQJTsoolmn3kTCn9m3RAIAVZrOyzQDL8GO1/ybDk/TukLQixEJRr8SB2YvRIjxT Ptd4GUAdnc2wrcwDGrU++WLfiZwwWuJdGIGUzraqxLNSxZjHNZY1F97npjq71rBGqZYst 59lG5xWe4LH0X+cEbOOeTM5L8gRDvjn6M8kVVCPksLZQ3NT6xmj3LQ2ZXkXApQH5nSJma poEBKSErz28QNzhuJdrt6m8EXfubOlL3QLKVzKCNQGdFwxddsjT12IlwLR36nU98sTA== 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=ZrNJ5hqj; arc=none smtp.remote-ip=209.85.128.50 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 820C1606A334 for ; Sun, 29 Nov 2026 18:20:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 820C1606A334 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=ZrNJ5hqj Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4a35a60499eso74188845e9.0 for ; Sun, 29 Nov 2026 10:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795976412; x=1796581212; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-type:mime-version:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ow0gh1mmdygv9Aa1zDYMwfVwIzWsW3h0z63AOxRo408=; b=ZrNJ5hqjMuehnHAEJZagCTCbODXJ3psRNqRrKDEJj02FgxUopOaK/ynh6lTCbuQ1hY DzyImEbxVKIP7sMVVhmO9MGLdi+tVEtgvn8dXduhcgNUkLGX9jCHVDwGLSQKqVD+LlOL 7cEJKC0JTfcW1Pic7TsGOUinEnY4EygWBSIsdh+cnoIAti2NgMd4ODA27Oo8ce1B1ODE 9gL33lvTgNDD0oS0Z7YTXoI00tc9pLx9E6Mv13VpmMWLu5dhzvHXyRU0tJc7Ry8VGR31 gIQi6Fa1uD037OhkZAWEph2aN8CSw9ix6xQqsNTRPH1gecBjWLwWE27k+Fe0X4Bb4zpb 71sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795976412; x=1796581212; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-type:mime-version:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=ow0gh1mmdygv9Aa1zDYMwfVwIzWsW3h0z63AOxRo408=; b=AAqi0BBmn3p1Ps8OAsSaY5AUKb1+8l81uae0/d90H/X0L9ahKJczG8MQYCPJuODuLv QeGH1P+kNTxbQ1HzAZ023h5Da29sCGIdZ9z6wsc8qrGr7xuaH1Ps0ip8gkQXTEeKrZR9 TyFDatlfA8exXGJXg3FwqCPDkFzF+8bG9qHHXxfa+YR8dfpODjRo1+TyXuITjZi/5eBr lv3aZxYbEcIgD/tvYJoryOPoN3xzPWDzBWlNvM9yfgO1rwvVI4X1ByM5sAtIuBrtdhpz tChFxpJIHR8cjsH5Nn0AFrPcgFGGVplGueNCkPO3EiV0kFEGPk94751yMPvTpXK/Fbej AFiA== X-Forwarded-Encrypted: i=1; AL+hErF62p7/yPI4Qwr8ANd4kQhNUqEU4uK+rI3ZD9Zq7/6dHQYn0Y3o6XdSzDYgJp2JOkLCFymDO4ovZW1agaWr@vger.kernel.org X-Gm-Message-State: APuU4Z99CKGxHgOG5t+IkmycXp2ittQb2G5GC2F8EB3oagUBULtTNksm +nv9mDO0Ia9ypH+6KshINPq1aAflRPmBRji/PqNkKyaT87DjMG95aIOh X-Gm-Gg: AZFdTZcd9eBdcePZOjUkwWyRxscRESKmTna61rw7EdOSRQt/2B3LmeGKAoFo3xBGdMR Lcrx0LRpQzSPxefgCzWvtknmrwjYzRdrSGydOhtybfRLN7jTy0GgOmsrFm6toaRbBnlvL6mTP6i VbzYqPiPX7veaFnbFsYlvHn96ORAymYK2un7gVutGX/RCMpXlGVS6+J5R/5lcNyaff4Q3X7sC0o CtpaZnhYIojdjmOEB9EpD/LvX/AWBdG6QHqjx8iblwgCwA7D9pkmafjuID3TXHttKvHKI4ak8in R5tXsha3Hoj2i22KDlZ+hV0mfThKUlhH1BrSHAwPGEkPzmdFFgNPB8xz8OOI2ywBTfbX3LhCmfX JCyQ9yCMvaCGNedy41Ob3yL1H/ovBtu/+nW8lcwIlk3mhT6jFfu0IDrXrCWh1mBbwZmd8wZo+rF IJeYxwf1Z+eAbcfROjAuArv0MZ5XD2PpGd7Y7Y2zCF4NgYU+WAeINI94JLp7O/r2KjYLaa+4+yF NhsL4y9Ue055NPOC1lad08shlpyfu3C27IB1wio27ebm4aDymBLqAhjy9UTDvDfje4CAamMgKTP sAqfVZ7gSmyFkUfEQZyhKT7iLw== X-Received: by 2002:a05:600c:154e:b0:4a3:59ee:86b with SMTP id 5b1f17b1804b1-4bb887c3b63mr646170455e9.4.1795976411684; Sun, 29 Nov 2026 10:20:11 -0800 (PST) Received: from localhost ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884865b1sm885774235e9.5.2026.11.29.10.20.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Nov 2026 10:20:10 -0800 (PST) X-Mailing-List: linux-unionfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Type: multipart/signed; boundary=7b0bd7f55c600d83f6b8122fba54f09b1885be508bfe8189a1af477ef183; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Sun, 29 Nov 2026 19:20:02 +0100 Message-Id: Subject: Re: [PATCH v3 3/5] vfs: add COMPR/ENCRYPT xflags from FS_COMPR_FL/FS_ENCRYPT_FL From: "koraynilay" To: "Amir Goldstein" , "koraynilay" Cc: "Namjae Jeon" , "Hyunchul Lee" , "Jonathan Corbet" , "Eric Biggers" , "Theodore Y . Ts'o" , "Jaegeuk Kim" , "Alexander Viro" , "Christian Brauner" , "Shuah Khan" , "Randy Dunlap" , "Chuck Lever" , "Jeff Layton" , "Jan Kara" , "Alexander Aring" , "Darrick J . Wong" , "Andrey Albershteyn" , "Miklos Szeredi" , =?utf-8?q?Pali_Roh=C3=A1r?= , "Lauri Gates" , "Christoph Hellwig" , "Dave Chinner" , , , , , , , , , X-Mailer: aerc 0.22.0-0-gc2f86b7abde3 References: <20261129024233.2361718-1-koray.fra@gmail.com> <20261129024233.2361718-4-koray.fra@gmail.com> In-Reply-To: --7b0bd7f55c600d83f6b8122fba54f09b1885be508bfe8189a1af477ef183 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Sun Nov 29, 2026 at 11:11 AM CET, Amir Goldstein wrote: > On Sun, Nov 29, 2026 at 3:43=E2=80=AFAM koraynilay = wrote: >> > > "vfs: add COMPR/ENCRYPT xflags from FS_COMPR_FL/FS_ENCRYPT_FL" > > This is not the best description of this change. > > A better description would be > > "vfs: advertise COMPR/ENCRYPT xflags in file_getattr()" > > Which is exactly the behavior change that I asked you to spell out. > You spelled it out in the cover letter, but not here. Hmm ok yeah now I understand what you mean. I should make the commit more about "let userspace know we have these too" instead of just a "add missing flags". > The commit message should also mention FS_IOC_FSGETXATTR > but for brevity the subject above is enough. what about this? "vfs: fileattr: advertise COMPR/ENCRYPT xflags on get" and the masks patch could become: "vfs: fileattr: add xflags masks to internal and user API" > The commit message should also mention FS_IOC_FSGETXATTR (And I'll add this to the description) >> Introduce FS_XFLAG_COMPR and FS_XFLAG_ENCRYPT to be used in the vfs >> _masks API upgrade for fs/ntfs ([1] and newer versions). >> >> Following the FS_XFLAG_CASEFOLD example, put FS_XFLAG_COMPR in >> FS_XFLAG_RDONLY_MASK but not in FS_XFLAG_COMMON, since it's read-write >> for some filesystems and read-only for others, to avoid breaking >> existing filesystems. > > This sentence is very hard to understand, because it is missing some > important information. > The CASEFOLD flag (and now COMPR) is only read-write via the legacy > SETFLAGS ioctl and read-only via the xflag apis. > Also in your documentation patch, you list them as RO/RW which does not > fully convey this meaning. > Don't forget why you started this patch set - BTIME is also going to be R= O > on some fs and RW on others, but in a very different category than those = two. > >> >> Following the FS_XFLAG_VERITY example, put FS_XFLAG_ENCRYPT in >> FS_XFLAG_RDONLY_MASK and in FS_XFLAG_COMMON, since it's read-only for >> all filesystems. > > ... in all the uapi flavors. Hmm, yes, but I should mention both "uapi flavors" and "filesystems", since casefold can be toggled only with SETFLAGS, but not on all filesystems, while saying that ENCRYPT is read-only for all uapi flavours doesn't mean that no filesystems supports setting it (well, in this case that's true, but in general there could be a filesystem that decides to expose a FS-specific ioctl to enable/disable FS_XFLAG_ENCRYPT and that reports FS_XFLAG_ENCRYPT in fileattr_get). Anyway, I'll change the message to be more easily readable and mention these cases. >> >> Also update vfs fileattr_fill_* helpers to convert these two flags as >> well. > > That's backwards. It's not the "Also" it's the main dish, as my comment > about the patch subject implies. > There is no "Also" in this patch - it does one thing. Fair, will change that. >> >> Link: https://lore.kernel.org/20261122000856.536902-1-koray.fra@gmail.co= m/ [1] >> Assisted-by: Gemini:3.8-flash-high antigravity-cli-1.5.11 >> Signed-off-by: koraynilay >> --- >> fs/file_attr.c | 8 ++++++++ >> include/linux/fileattr.h | 7 ++++--- >> include/uapi/linux/fs.h | 2 ++ >> 3 files changed, 14 insertions(+), 3 deletions(-) >> >> diff --git a/fs/file_attr.c b/fs/file_attr.c >> index 5d3834f4405b..314d779e41d6 100644 >> --- a/fs/file_attr.c >> +++ b/fs/file_attr.c >> @@ -39,6 +39,10 @@ void fileattr_fill_xflags(struct file_kattr *fa, u32 = xflags) >> fa->flags |=3D FS_VERITY_FL; >> if (fa->fsx_xflags & FS_XFLAG_CASEFOLD) >> fa->flags |=3D FS_CASEFOLD_FL; >> + if (fa->fsx_xflags & FS_XFLAG_COMPR) >> + fa->flags |=3D FS_COMPR_FL; >> + if (fa->fsx_xflags & FS_XFLAG_ENCRYPT) >> + fa->flags |=3D FS_ENCRYPT_FL; >> } >> EXPORT_SYMBOL(fileattr_fill_xflags); >> >> @@ -71,6 +75,10 @@ void fileattr_fill_flags(struct file_kattr *fa, u32 f= lags) >> fa->fsx_xflags |=3D FS_XFLAG_VERITY; >> if (fa->flags & FS_CASEFOLD_FL) >> fa->fsx_xflags |=3D FS_XFLAG_CASEFOLD; >> + if (fa->flags & FS_COMPR_FL) >> + fa->fsx_xflags |=3D FS_XFLAG_COMPR; >> + if (fa->flags & FS_ENCRYPT_FL) >> + fa->fsx_xflags |=3D FS_XFLAG_ENCRYPT; >> } >> EXPORT_SYMBOL(fileattr_fill_flags); >> >> diff --git a/include/linux/fileattr.h b/include/linux/fileattr.h >> index fb158269b4ea..9a8de4190133 100644 >> --- a/include/linux/fileattr.h >> +++ b/include/linux/fileattr.h >> @@ -12,17 +12,18 @@ >> #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_VERITY_FL) >> + FS_PROJINHERIT_FL | FS_VERITY_FL | FS_ENCRYPT_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_VERITY) >> + FS_XFLAG_PROJINHERIT | FS_XFLAG_VERITY | FS_XFLAG_ENCRYPT) >> >> /* Read-only inode flags */ >> #define FS_XFLAG_RDONLY_MASK \ >> (FS_XFLAG_PREALLOC | FS_XFLAG_HASATTR | FS_XFLAG_VERITY | \ >> - FS_XFLAG_CASEFOLD | FS_XFLAG_CASENONPRESERVING) >> + FS_XFLAG_CASEFOLD | FS_XFLAG_CASENONPRESERVING | FS_XFLAG_ENCRY= PT | \ >> + FS_XFLAG_COMPR) >> > > The addition of FS_XFLAG_CASEFOLD in FS_XFLAG_RDONLY_MASK and not > in FS_XFLAG_COMMON left the code in a very fragile undocumented state whi= ch > took me personally a lot of time to figure out. > > Let's please document the meaning of these macros better. > I propose something like: > > /* > * FS_COMMON_FL/FS_XFLAG_COMMON are preserved through RMW > * cycle via either uapi flavor. > * They may NOT include flags which are read-write via one api flavor and > * read-only in another (e.g. CASEFOLD, COMPR). > */ > #define FS_XFLAG_COMMON \ > ... > > /* > * Read-only xflags via FS_IOC_FS[GS]ETXATTR and file_[gs]etattr(). > * The respective flags may be read-write via the FS_IOC_SETFLAGS ioctl. > */ > #define FS_XFLAG_RDONLY_MASK \ Yes I agree, I'll add these to v4. Thanks, koraynilay > Thanks, > Amir. --7b0bd7f55c600d83f6b8122fba54f09b1885be508bfe8189a1af477ef183 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSgVimKafU5DQMcjcDmj22qf5IGXAUCawxs0gAKCRDmj22qf5IG XE1dAP9HI0MZWGxSqaDITJoPjScqEK8WFXh1aLfDEqxdIdw5nAD/eYQvju2L0qJy 7AOHwpAAlgClZZAtiXgEz6WmiPLzhQI= =NtbT -----END PGP SIGNATURE----- --7b0bd7f55c600d83f6b8122fba54f09b1885be508bfe8189a1af477ef183--