From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796154676; b=d5MoK36KnXCKcGw1ZhWEs09cMyiZMMFlw2fVtKBQDv3xMZlL602KYn83MC0ric+X0T9D ooKmj10dfuZMHb3gV6e97A0XmxjYjrr4CKQtZiHhV5npJ0GaEaCW7/NlZ7Xnx3uFWuKVO XoVpB5/G8SfXHuB2mJXOp9wx69U8Uxwx/plRXmhPk46OVEXmUuliZrwQYwyckWWRHw9fl ij3UilF6Z6kjsdZC8aYH9l0zjEZlrXkToYDjhsMGHgVbksbDAKDfM2Mo69yw9dIH4EZmW 7CPb2eLjgSGQHeRSwfPa+Gf71zU8hCeajkeWKhz78EZrIFyGa/UEw9sZoA4fdKpHHxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796154676; 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:Cc:Subject:From:To:X-Mailer: References:In-Reply-To; bh=gnPu9XE9PUT95PocaY0RpFr6nxvoZAP5N9XrXsD+RzE=; b=25HP8HNkgrBqX9r03P1o73sy3LkA+xKfx0iTcb9YD7YfYnORlDupJmo69zLjWlV0sLTK 1kqO89Toa5Pn5nind8xqrI6wOtGko0PDdyz3KnVXS0joctfPdXEvFAd1NrjNRx67X5zUE DBkjcmEXCNKI2nITIeuGBNSFgj+S8/Tec8mI97EYWYNuvIVBRbZ6nBK7jfqZAHp31+CF1 v5T+kJ8Ji6FgPicIj5WP1nC+/3Ns+FuxhkGJkkhUNlhTyQzE41Pl/3j4NJDpDc1bz1Rhh 5nl5lxmTVG1jMRyI11wcF1AGP7QLY+aGb5cd1chaH+dRgeUWKAGIeRPnnjSXFc+2/wQ== 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=gvlkuxau; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 74498606A320 for ; Tue, 1 Dec 2026 19:51:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 74498606A320 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=gvlkuxau Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4b467581b98so114017585e9.0 for ; Tue, 01 Dec 2026 11:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796154675; x=1796759475; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:mime-version:from:to:cc:subject:date:message-id :reply-to:content-type; bh=gnPu9XE9PUT95PocaY0RpFr6nxvoZAP5N9XrXsD+RzE=; b=gvlkuxauT/CnXA1sHouDNuFRJemeiuB9/BWxvT8yktMKNqGmy2/pelzhufmfMehwLo T0vQkumkb5/Z6fbmjATQbAf/T/4q+QRWzOcVOJ/OuXPBGFqRObZhhojT73d6I5mZgk9K JTJT0peR8ZRIHo+o1cmdPl55TSKOcYRBFip08XHiM/aTsRPPqKUCZ8GN+JZweTkSaWIQ JcJT7/WCu77prkf21O1iQyH2eiieDZgjJuEBXtOQ1aQJGQbyFSMjbi+SLxLH7y0ukLhL WMMVLY6I7p2dNPb4rVoev0qcov2+rgvBW0rKJE6KS+t4FVpKjvdnSaPUhqAe2Ww2daOS YFFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796154675; x=1796759475; h=in-reply-to:references:to:from:subject:cc: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=gnPu9XE9PUT95PocaY0RpFr6nxvoZAP5N9XrXsD+RzE=; b=R/52gNkSHkhdFeSe6vjrrDgbhkCMLC62H4xccdc86YDjLq5s0w+U1ZyiKXhEbE4o+V a2WxRi81oCXttcuhDu3zT/ztm/NEYc3kw/R02cP+C91iJBYdjW3k8I7zTRqm4LsKpo1R K34N8ARgCSl1N+9msoRKUzdFiMuq/u/y01N2/lAag5qtQT6ET4VLTOfY5nMDHOVIT6be of5zx2dLz5IA4MdAOsYqcI59DXqiDeW5EwLF1nD+puDFjt6MH3pmcXiIyHrzoJ1s5gCc msPJmAwakLZqmBVV1I+B5/8JEgipktYAFDruG2qrfi8sV74b6gwNEKyYPENMLd+pmael 2Zjw== X-Forwarded-Encrypted: i=1; AL+hErFEuTlVYNlZ39VwzGO8GC+P1OMkVecBAqlMyXVnRDng0A3atqiR/TgFlOdJIy/EtWB9IHyy2w8KUp0=@vger.kernel.org X-Gm-Message-State: APuU4Z+2ew3R1CkmMEwUZ3TAoHDzQoSK0TIgMNNiq4lnmaajQB2KhIvs vVN7ndjbzzkw2J0Z49Nf0hbrJ2WcpQwK6UaQwvgvM9m4FC4aenkBnz5D X-Gm-Gg: AZFdTZca4hw5IMwDG4/nlK37cf0tgrM8qYx/dSgo+gpWkULkX0AJfSMlXLqbu4MElpJ FRNyfclqI6jjnKCHt6NoT5RGMDiDbTVjci1HhQbbGnCM1KDNrHFcmcQXGXC1hN9W9n+lZzjnWMz yGiUxIeCA7DD1FYKDcDEetMXvW2o2knsRHb7hpEbb72+HsvkkSGoenpNTuV5d6RN7hAtZKq7SEb 2yLbGt8+5pHwNAzwCm/fpKHtF4sw8G0+mNCJmS5f7RSI9+ERARClzA4YMNR4ys150BzB+OU4czA OoBN9Sb0Cr1F15Ui3ofsvkc1Uy8fgrUJscPmJOPUvkeHFvQcoDFBumXfPKnv80zoGbBK4EYYxZp jxib8ec1w1sp/9Gx9H4N1nivHFLMCQQQqf3UIG48rgRVWh56mrjPAEnyq07dIjUoqTW/LhQQ5SX jziaDvD1oGpzsQcGIZeQZcUfmIC8MeGRSwAp7RjWQKoyWVMQel5JOOAUiBpB2mjnpnhSgEQLdTq JiqWH8hE5DuQAU2zwwWmT4Mp6xP/s/W+Un7TPjiUq35rAvEYTp7Qyo7ejWxQX4LWB+A4uz8nO+Y P+KEDrqoQZu+d9OzQaqAgJ06QT0= X-Received: by 2002:a05:600c:674b:b0:4bb:6947:3e1d with SMTP id 5b1f17b1804b1-4bb8892c0fcmr662970155e9.20.1796154674737; Tue, 01 Dec 2026 11:51:14 -0800 (PST) Received: from localhost ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb853b216esm1098121175e9.12.2026.12.01.11.51.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 11:51:14 -0800 (PST) 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-Type: multipart/signed; boundary=a984602e007121e6690a29504d7920ccb5047bd3e28de128a8cf0f16607f; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Tue, 01 Dec 2026 20:51:10 +0100 Message-Id: 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 v3 2/5] vfs: add xflags masks to fileattr API From: "koraynilay" To: "Amir Goldstein" , "koraynilay" X-Mailer: aerc 0.22.0-0-gc2f86b7abde3 References: <20261129024233.2361718-1-koray.fra@gmail.com> <20261129024233.2361718-3-koray.fra@gmail.com> In-Reply-To: --a984602e007121e6690a29504d7920ccb5047bd3e28de128a8cf0f16607f Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Mon Nov 30, 2026 at 11:54 PM CET, Amir Goldstein wrote: > On Mon, Nov 30, 2026 at 10:25=E2=80=AFPM koraynilay = wrote: >> > ... > >> > This is exactly what I was looking for. >> > PROJID is only singled out in one place (here) when defining the macro >> > and a comment above the macro explains why. >> > From this point on the macro describes a trait, which has a very clear >> > meaning, without mentioning any specific flag. >> > >> > Good job, bot ;) >> >> Yes, though, when trying to change the current code to use it, I'm not >> liking the name too much, since it seems like it's a subset of >> FS_XFLAGS_FSXATTR_MASK, while it's actually not, since >> FS_XFLAGS_FSXATTR_MASK does not include PROJID. >> > > IDK, you can try _[GS]ET_MASK > it's a more accurate description. (definition reminder:) /* * Writable xflags used to check and convert from masked request to unmaske= d * request. * Includes FS_XFLAG_PROJID because masked requests use it but unmasked * filesystems that support fsx_projid don't know about it (because * FS_IOC_FSSETXATTR has no FS_XFLAG_PROJID bit). */ #define FSX_FSXATTR_SET_MASK \ ((FSX_FSXATTR_MASK & ~FSX_RDONLY_MASK) | FS_XFLAG_PROJID) Which of these do you think is better? FSX_FSXATTR_SET_MASK FSX_SET_MASK FSX_UNMASK_CONV_MASK FSX_UNMASKED_SET_MASK FSX_CONVERT_SET_MASK FSX_COMPAT_SET_MASK Thanks, koraynilay >> >> Also, could we change FS_XFLAGS_FSXATTR_MASK to FS_XFLAGS_FSXATTR? (a= nd >> >> so also FS_XFLAGS_FSXATTR_RW) >> > >> > This reduces readability considerably IMO. >> > There needs to be a clear separation between the >> > flag macros and the flag collection macros (traits if you will). >> >> Hmm, fair, I proposed this change because the names are getting a bit >> long and formatting the code is harder, also they have FLAG*S* that can >> indicate it's a collection, but that's easily missable (and indeed, I >> can never remember if it's FS_XFLAG_MASK or FS_XFLAGS_MASK, one more >> reason removing the _MASK may be beneficial, at least to me lol). >> >> >> And I'd also change FS_FILE_ATTR_XFLAGS_MASK to maybe only >> >> FS_FILE_ATTR_MASK, so it's not too long. >> > >> > Losing the FS_XFLAGS_ prefix is not good IMO. >> > I did want to offer a change to FS_XFLAGS_FILEATTR_MASK >> > to be consistent with the rest of the collection/trait macros. >> >> Hmm, right, FS_XFLAGS_FILEATTR_MASK does indeed look better, though it >> is getting a bit hard to distinguish between them when they have such a >> long prefix. >> >> FS_*_FL are easier to read. >> Actually, could we maybe do something like FSX_ as prefix, if the FS_ >> prefix is not that important? > > It's not that important, but.. > >> >> FSX_IMMUTABLE > > This is in the uapi and changing them in kernel will be a lot of churn > >> FSX_PROJID >> >> FSX_RDONLY_MASK >> FSX_FSXATTR_MASK >> FSX_FILEATTR_MASK > > Those are fine by me > >> >> or if FS_ is important: >> >> FS_FSX_IMMUTABLE >> FS_FSX_PROJID > > Those not for same reason > >> >> FS_FSX_RDONLY_MASK >> FS_FSX_FSXATTR_MASK >> FS_FSX_FILEATTR_MASK > > Those fine > >> >> or maybe? >> >> FS_XFL_IMMUTABLE >> FS_XFL_PROJID >> >> FS_XFL_RDONLY_MASK >> FS_XFL_FSXATTR_MASK >> FS_XFL_FILEATTR_MASK > > Those are worse than all of the above IMO > >> >> or something else that is shorter, idk. >> >> >> >> >> And at this point, we should consider all _MASKs to be frozen and onl= y >> >> expand FS_FILE_ATTR_MASK, with the exception of converterd FS_*_FL >> >> flags. >> > >> > This is something that we can definitely document as a guideline - >> > use the latest v1 syscall uapi for new flags, with the exception of >> > xflags for existing FS_*_FL flags. >> >> Yes. >> >> > However, a filesystem can only report a new flag after it has opted in= to >> > masks, >> >> Report as RW or as RO? >> >> Since for RO reporting it doesn't need to, it just needs to do that for >> get (and actually, only for the wanted xflag, it probably doesn't even >> need to report all its xflags in rw/ro masks apart from e.g. MAYSHARE... >> or maybe not even in the masks, since on the set path vfs treats it as a >> "legacy RMW"/VER0 filesystem). >> > > Whatever guideline you write - if it makes sense its good, > >> > so if a new flag requires converting many filesystems, >> > it may not be realistic to maintain the freeze rule. >> > >> > Hopefully, the work on the may-share flag came just at the right time >> > to allow for the ro_mask exception, so observing the guideline for >> > new read-only flags seems doable. >> >> Yes, MAYSHARE for testing read-only, BTIME for testing read-write (and >> read-only). >> >> > >> >> >> >> so: >> >> >> >> FS_XFLAGS_FSXATTR would have the ones that are in right now + all new >> >> FS_*_FL converted ones (same for RDONLY and COMMON, etc) >> >> >> >> FS_FILE_ATTR_MASK would have all FS_XFLAGS_FSXATTR + all new ones >> >> (MAYSHARE, BTIME, ...). >> >> >> > >> > Yes, it sounds like we are converging :) >> >> Yes, though that has been my thinking since the first time I wrote >> "FS_FILE_ATTR_MASK" for the ptime patch :D >> > > Yeh this is a tough one > and this is before the patch set got review from a wider audience... > I praise your perseverance. > > >> >> > Isn't PROJID in FS_XFLAGS_FILE_ATTR_MASK, but not in >> >> > FS_XFLAGS_FSXATTR_MASK? >> >> > Is there more to it than that? >> >> >> >> Currently it's set like this, and there shouldn't be anything more to >> >> it. >> >> >> > >> > Nice. Looking forward to v4. >> > I hope I have some time to rest before, but probably not :) >> >> I should take >=3D 1 breaks too instead of working on this when I'm not >> doing other stuff, but I already know I won't :) >> > > Maybe if there is AI outage you can rest :D > > Thanks, > Amir. --a984602e007121e6690a29504d7920ccb5047bd3e28de128a8cf0f16607f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSgVimKafU5DQMcjcDmj22qf5IGXAUCaw8lLgAKCRDmj22qf5IG XELsAPwNuKdSnH9OOeUU0WOCuwQ93MlYlu4XpqnAszCzIazLZwEAlbCctyrVKNRO p6mjzQjs269WDvMM69lAx1TvLY+PiQc= =m5MA -----END PGP SIGNATURE----- --a984602e007121e6690a29504d7920ccb5047bd3e28de128a8cf0f16607f--