From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796336610; b=0NMN46s9+OGNcZPD7e3SxDgbFHGbVOgDRjpB9/og7R4vQcTIyIvpznlHvoomHeDwfXUU L9AwBdq26Gv2dXIdPJkDI9ww91vB/7VAnfLajLZGYC8VwjrJLVxDhZyP3N0mIGv6SGj1V owgCxTw7CHShc9e59nX0eVwgp6xsRn8c62eVJkWQQHfCE1X5t85hXUQtPeXJTjcqoqoBM HzT0uTiA/Yx9q9lis/b1Q9Ln4aDimnDsi/PFcdhOx239PRDZXhllSBz0VLI1njcddgm0O Czj7hiGUFI/DASMqh/ufPVhBZA8y4EQyC7YpEMzYbp+sabBMNLiiLbGI/Adv6NCDTjA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796336610; 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:From:To:Cc:Subject:X-Mailer: References:In-Reply-To; bh=XGn2uOresqLBKUjwAkGRmoQ/E3gBHKExwjgiPJ9IKwg=; b=zuGtTZDPNAadd0hWjgzqnpE7JCV6eZo4utPjSt5RIzxhNN+/ZJ5LPhrL5zRAMMHz2JQV wbrV3ofQJGI8m6IFTrJJrOEa72b4wp+irjRYnbuJ2ccjc6xr9jjutwD7eU3bAwrUEhNOR vKIpqz3/7IWituXv7ZKJ9TCrlSwxGEqyFTSau/E8j3CYWL7R2dVVs36nT/5gVHttgrDJX BYCdsD0x1Q1mqospqQaH7z/py41tu2HywvuAelMCGI3uF6OUU4eP2bhLd7lnS6H0/7gUj 3EyliMZLtBwMRdkQAnLHfAC5oLJ96e1J9bJTbkL/xgciO+pxb4r8+2ENHCK9HVJ5n2Q== 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=aDnSoWga; arc=none smtp.remote-ip=209.85.128.41 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 B4CE1606A330 for ; Thu, 3 Dec 2026 22:23:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B4CE1606A330 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=aDnSoWga Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4bb70074ab2so112715e9.0 for ; Thu, 03 Dec 2026 14:23:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796336608; x=1796941408; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-type:mime-version:from:to:cc:subject:date:message-id :reply-to:content-type; bh=XGn2uOresqLBKUjwAkGRmoQ/E3gBHKExwjgiPJ9IKwg=; b=aDnSoWgabMxGBFqTL7kvFMbveKvclFoEAOk72DbHZ4KY+TO4leWyqQr3v+Mv4Sgu1d hmqGxmP+OMXmykfhEDbqDb36BIvnslcGlUxFQrZmGaW6vTZrR8OaXeA1YUxS8lG1IlD5 PK8PtJ9APgeoaaRNrSa2rLtPM6URdY60r5nk8ryAWqSA2SCQrLgqeEImOiK2QTb8tB2b T/q+RDOryuxjLISdJJ7yCdp/lelDWi8g/xPGYDLZ3QO7SLnqUF+rX9UW/DzEizuVPDWM +6BW3Xeg0ntYLli3pz7d51E4jrkcO4naovag9nzEAfJJUm7cqVnNlR+ZUDk5hbhOwfVD 69gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796336608; x=1796941408; h=in-reply-to:references:subject:cc:to:from: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=XGn2uOresqLBKUjwAkGRmoQ/E3gBHKExwjgiPJ9IKwg=; b=BTYrS8HpAongKTq0Kuid91fRYLuq2eLuExzEh3cb8FJjqeYWdMCJbk+nATNOfyg+o4 5Fl77dhRnKcXmVBSeo7VPtryh3+zJ9HnjDMs5HNRFTVqLTJpT5j7SA+PrnCCMYc9cnc+ Y6GGwHtyjE7yY0k0x+vqF+hqa9w5kpf/Sq9N0ZQMzXSI6U3z2BGLI4gsyo/p5BAYwdWn FSyVX0VrsE/Vma6s0g5fwNAnL20NDdLFCt1ryUewBuEv5mm95NSITFNyqEEH5W+Lc3m+ dJjQaOryF6I4jQf+iaX/Zctu4d5qNcI7Nte2tl9u4KmaXIdiTc5PmaF14M4Q/T1B1ge8 UuWA== X-Forwarded-Encrypted: i=1; AL+hErHNSC+MMebt6AugSx4OM0QLVaBkCt1tY2eRrr6XWvaldp5+uBqj3xJqwkhDjouaT6V1WnhKXqxDjwRCNnk=@vger.kernel.org X-Gm-Message-State: APuU4Z/8sxSJwp/Ni4DNdkYdWpFD2+LQ2QhrRWz/Xl4RIl3A/EHIIAqh nWJzG87CPhUc+2UuIUujAuwOXCfeDYe2zJniBC/3I9EIf6HFxrHJOHVD X-Gm-Gg: AZFdTZfDvfwLcx5BI2ZmQPZP3xWpSnB2mvde7sf7+pHUGm3H89EF0gvRUHxyWst56Ba BA5H/45cE8mgyz0eY00D5T60KawBYCUXFO9LxAGk0VRX97fgpc7/rCV0KBnwosRkcMYrwE/GVDd M+uG9ATuKKO8NeD/9ZsbLkkI8Uku0KqbtDIwIimNm6wwd6lmVkDsD7r7D+Mc/iYq/OG9Qzed4Fb MmBrlkO6ypjyPcgk8jVuVaCdTl6IJSpJkOd9Y0dI0oaV5v5/cgpluJUaP7n8iNhVS7mAwetGG5H JPNkRoWHcgZ8nBnMZp0VSTnxMGHjFHmDnl/hHdRxBzf5fm5u1FSOdYrSrAcDdhkthgQcmid9tCZ dbjfPTXJPf198XPnvUypcxeb+r0aTRRpfYELSXz0GGLKlDZ0xd579P/54niCXOeRhbb8vwC8mX9 PFUyrw7vdsNsVN7QPBfT4qHpDS/NR1bTxTtvv74aAfQp0qgA6Z5LIKMUBvxgCvzN/BroOiesI4T dEimQqYaGmr1AEzL3ymrH7VEaIZ/nWEZkNchl8oCO4Jju6JF5wcD2z2UIRvlpmt3WtrjVDFDP3Z k3GtDO2kLwMt0tdW3otxSEJVDQ== X-Received: by 2002:a05:600c:46c9:b0:4bb:5f07:10d7 with SMTP id 5b1f17b1804b1-4bbeb8eb672mr667115e9.26.1796336608203; Thu, 03 Dec 2026 14:23:28 -0800 (PST) Received: from localhost ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbea0b7f47sm6068045e9.0.2026.12.03.14.23.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2026 14:23:27 -0800 (PST) X-Mailing-List: linux-kernel@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=e7f649bb5b4faa433540f2aff5007873e6a1a00bbd86447a122cbe8ade7c; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Thu, 03 Dec 2026 23:23:25 +0100 Message-Id: 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" , , , , , , , , , Subject: Re: [PATCH v4 0/7] Add f*_xflags_{rw,ro}_mask flags to the fileattr API X-Mailer: aerc 0.22.0-0-gc2f86b7abde3 References: <20261202215427.798262-1-koray.fra@gmail.com> In-Reply-To: --e7f649bb5b4faa433540f2aff5007873e6a1a00bbd86447a122cbe8ade7c Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Thu Dec 3, 2026 at 7:10 PM CET, Amir Goldstein wrote: > On Wed, Dec 2, 2026 at 10:54=E2=80=AFPM koraynilay = wrote: >> >> This is a follow up patch series stemmed from [1] and [2], splitting the >> _mask change for the fileattr API into its own separate patch series. >> >> The series extends the fileattr API with xflags masks by introducing: >> - fa_xflags_{rw,ro}_mask fields to struct file_attr >> - fsx_xflags_{rw,ro}_mask fields and has_masks / use_masks / get_only_ma= sks >> selectors to struct file_kattr >> - AT_FILEATTR_MASKS at_flag for file_[gs]etattr() >> >> These masks have the following semantics: >> - rw_mask: >> * for filesystems: advertise which xflags they support changing >> * for userspace: specify which xflags it wants to modify >> - ro_mask: >> * for filesystems: advertise which xflags they support only reading >> * for userspace: ignored >> >> This allows userspace to not have to do a RMW cycle when using the >> file_[gs]etattr() syscalls, avoiding possible race conditions and >> simplifying their usage. >> >> The series also introduces the missing FS_XFLAG_PROJID flag so that >> programs like chattr can leverage the new mask API. FS_XFLAG_PROJID is >> kept out of the legacy FSX_FSXATTR_MASK and defined as part of the new >> FSX_FILEATTR_MASK group of xflags that will be used moving forward for >> any new xflag (like the one proposed in [2]). >> >> In addition, FS_XFLAG_COMPR and FS_XFLAG_ENCRYPT are added (as >> FS_COMPR_FL and FS_ENCRYPT_FL counterparts) for fs/ntfs, which is >> converted to the new mask API as an example. Old programs will also get >> these new flags, which should be fine since xflags were made to be >> expandable. >> >> Documentation/filesystems/fileattr.rst explains how this API can be used >> by both userspace and filesystems along with the various semantics (it >> doesn't go into *too much* detail though, since that would mean writing >> the code itself). The rendered page can be found at [4]. >> >> The series has been tested with custom xfstests [3] (generic/816-835, >> xfs/611, xfs/673) across NTFS, ext4 (project quotas), XFS (project >> quotas and extent size hints), Btrfs, and F2FS. >> Note: these tests were written by gemini and not manually checked, >> before sending them upstream (if needed) I'll have to review/rewrite >> them manually. >> >> IMPORTANT NOTE: there are quite a few bugs with overlayfs >> (generic/832-835 above) when using a masks filesystem, I haven't >> investigated them deeply yet since I would first need to understand a >> lot more how overlayfs works, but the robot's report is in [5]. >> A few of them can be fixed with the robot-proposed simple diff at [10], >> but I haven't investigated much why it works (as I also don't really >> understand well how overlayfs works yet). > > You can ask me ;) One of the reasons I added the robot report and fix ;) > These bugs are real. ovl_fileattr_get() reports the real layer's masks > as its own, so overlayfs gets masked set requests, but ovl_set_protattr() > treats fa->flags as the full set of flags. For example, chattr +d on an > append-only file would clear the append-only flag. Ah ok, I'm gonna have to understand better how overlayfs works though, right now this basically just goes over my head lol. > This robot fix [10] is correct: Nice. > overlayfs does not support masks on set. > Please post it as an overlayfs patch in this series, before converting > ntfs of course. Ah, ok yeah that makes more sense (I debated whether to include it as a patch or not, but I would've added it at the end). Thanks, koraynilay > Thanks, > Amir. --e7f649bb5b4faa433540f2aff5007873e6a1a00bbd86447a122cbe8ade7c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSgVimKafU5DQMcjcDmj22qf5IGXAUCaxHr3QAKCRDmj22qf5IG XL8rAQC1n+FfqLgimpPsfUo/DopwVgDap8AqAH23nq2Zw6RbagEA9Qza7P5si65k Yh2IadHn+/IckDFH7AVOI/eUFvoy3Ak= =krjE -----END PGP SIGNATURE----- --e7f649bb5b4faa433540f2aff5007873e6a1a00bbd86447a122cbe8ade7c--