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=1796074150; b=e+5yNUx1GuR90h4zyCVEi/3OHKJzhJTSAZ3SpsnBbNIPcqEK1wVm5Dgcz3ZHgEx3zqZh 8uBeqiHLrcB0tNw5NFjW+AMsPRZ/3sQ3Qk6NeWSPRMmPBiMAbr6cX9kn8IbX3cqfDdzmO yXN8u/6fc6u/QVnhAy8SuoiZ5OzzOm2r/wZno6ep5t0djze+UiXUn3r4oQDq+FlX2iCvf EE4Dimm+uygmZ74J+6vzYsi0Qn/wO5VA6jN/1LHehXnBRUOSEQWtTOIR83LIodyyDlWyU x2jnS8BZPDh7CpNDsdVll0mL1kkrUWskJT9iB5XrSNdlsnMqi0alOjzqQBhP7KBSHeA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796074150; 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=7Z54FGg7Vgv08wW7TsR96vhuUbm3tfi6jfh0StT1PCU=; b=EhbQ5G6fK9kLn4Y6kUnsy2uztgzVd5mzOKjkPKr1b6mMsm802hVN+HlNG78d3oU+Q0G2 HaJSB7YHdSWRoCmy18YPHY8ovfkmEbosGwph12RGIKik+MI+vaSDO3SMOrHaF8jJcXP1R QO9ZeXtryrYWNQpgXQUGE1f/d7YiMnTMR+t6iQHGxht0Lpac01WZhIe1hybskg7CxdAPT OdPkfHOp2YVimpxt6yZKC7rCI4Awn3J3TqKuB3VoTphTJvsnf/7X3Se6hmfPuBSNOXDHx 8a255njMpAtqzwGv1t3dRmNOujH9UVFx4rkEo4mRdZIsejUVpnHPQG1JvRqJPzWh6/Q== 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=vL3QiY2A; 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 5D490606A32A for ; Mon, 30 Nov 2026 21:29:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5D490606A32A 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=vL3QiY2A Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4bb9d8e8e90so80668995e9.3 for ; Mon, 30 Nov 2026 13:29:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796074149; x=1796678949; 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=7Z54FGg7Vgv08wW7TsR96vhuUbm3tfi6jfh0StT1PCU=; b=vL3QiY2AxHL9YR9wwUlfnQVA9AyEcIMv0uTf9wtEDq/S7+0z8CWX7iSjbeGYr7ga78 ZooX6dSjxCwqMzy6BDOL40gAhGgITHWjl7ihNCn257VDb5ohjlPrmx4JRjVJLWxiPWuG bFs4UJp7P4ji8c1LY1r0apCdoFOYV7qSMvANIl6xQCWwYVpF2nc9Y8BcwXOABb8sjM2w S9YpKeLN90X+sXIrJW8UG6DCTsSwyJ7U0ZZjsPpbk/gIMSs+PP/nfH2VJqtuX0zmMlQL M7ndhmbWh93cAaXEjGoumyS5Hkl9qsqQRhY5vrXsrAfA5QB+LtOzn/t049aqEIvzGK1t X5qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796074149; x=1796678949; 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=7Z54FGg7Vgv08wW7TsR96vhuUbm3tfi6jfh0StT1PCU=; b=yb/gUC+18sG8W+EegWSyMEj7N27LUMzQ20+vT+/jximMYwpbexgK8GFVUCuC/ewt9u LGd83OVy6rZiFeTHbpmpcRJGCTCH1Lw/JJqS0tMtRFSZcmo0jx0Yubzjzzv668bdHpIs k+Gw2Cy0/Wb+2F6JmFYVNR1G35+XS512zhv9T9F30f4LTh1NuQ12G2d+3n2SCkFqJxDA gAhmljb7KI9CIORt8O7vnIHoUjOQLhw8/XfHsswQgQpYDkMkwq23PzXcfgdA1F0frceE aM4qd6gnGa55+BAyWXez5BJR5Qrc76lGHl1LkkLH60Zbd3ZZtZirwm47e065LMBbDTRq JHJg== X-Forwarded-Encrypted: i=1; AL+hErG6WXe6edYbueb6XyjuiBybTg5AWjr9rZrqv3o0QWxA31CVaZTSDH9LNSLcu+yCPjrhdwkdXbCUrIc=@vger.kernel.org X-Gm-Message-State: APuU4Z9SaftXp5qzXg3atuiXQ/dGIbiDp/+WtixJCV0vSWYjIcKRIJtv j3hlFRbFVRvNIqJXWLUZA6X8TV/37oxl9I756d1sOAnlRTGnJuY8uyKo X-Gm-Gg: AZFdTZcXoxCupTQdMSPnqOGnKqAkj+9F7SpuZnjgYK5Hu0/8gOez5oVYBm3vZe3BhyC 45S8l8atdj5rhEif3dv9crst9yBmfeh1+iT/iOJxzwV7BTvP6edPogqsXcDYPvDnFg/2KFjZrJd slGw4YvydEMiVo4f2vGuThXu37regUCWa6lTpv/NpvQfA3pTnuYa/P3V3Toe3BgQNZgHEH1zk8V 8tbj/1bpQx8MzeP2kziN9ZHIpq/3w7JW6EX7XP/jS9J/uExripKfkGW9LtZfSIA+H6qs8DfYzHi VX1hqmYxu/RJFKnnJ1G5UFseDe7a4XyjrDfsh4u/gsmkgsG3in/OJV/RNM/4HgWVxbqz02m3L8f TYbqdh5JNBhbRPQCHWjyq2XH+CfLifNki2klpdzHE8F2MeJ6XXAzSC07/V4t1MUwruTM8AO5fWp +sxOjJpm6EBWq9Mzrbxik9xzEwCjbmt6RzplV2Or2D4BTozjJTGjK3sNty3OiQh+5fTmbb4TM1f wVTMgtADFNQAZIaquDT7IswIywcGh7v2YAHRCLfAqCJtq6Ydl1+FRNVztytCFU8jHEkdRyzTG48 yn1ipwWIDP2Sp707+fgfLaJpXg== X-Received: by 2002:a05:600c:3ba3:b0:4bb:7571:5743 with SMTP id 5b1f17b1804b1-4bb88813444mr801113905e9.27.1796074148515; Mon, 30 Nov 2026 13:29:08 -0800 (PST) Received: from localhost ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb853368d3sm926170925e9.1.2026.11.30.13.29.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 13:29:07 -0800 (PST) X-Mailing-List: linux-nfs@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=eefc83f33b94c9ec17a59381db65d891745fb0197d21a109a97cd9920e45; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Mon, 30 Nov 2026 22:29:06 +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: "koraynilay" , "Amir Goldstein" 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: --eefc83f33b94c9ec17a59381db65d891745fb0197d21a109a97cd9920e45 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Mon Nov 30, 2026 at 10:25 PM CET, koraynilay wrote: > On Mon Nov 30, 2026 at 10:04 PM CET, Amir Goldstein wrote: >> On Mon, Nov 30, 2026 at 6:22=E2=80=AFPM koraynilay = wrote: >>> >> ... >>> >> >>> >>> >> >>> For PROJID, personally it could also just be put in FS_XFLAGS_MA= SK, my >>> >> >>> concern is that it may break programs, even tho fsx_xflags is al= ready >>> >> >>> expected to grow (as per your 276e136bff7e ("fs: prepare for ext= ending >>> >> >>> file_get/setattr()")). >>> >> >>> >>> >> >> >>> >> >> I am too concerned that this would break programs. >>> >> > >>> >> > Hmm, I'll ask the robot a bit about solutions to this, but... >>> >> > what about adding an exception for PROJID that it must never be se= t in >>> >> > fsx_xflags and only used in rw_mask (so for chattr -p)? >>> >> > >>> > >>> > I don't think this is the answer. Let's see what the bot has to offer= . >>> >>> So the bot said that keeping PROJID outside of FS_FILE_ATTR_XFLAGS_MASK >> >> Don't you mean the other way around? >> >> PROJID is in FS_FILE_ATTR_XFLAGS_MASK and not in >> FS_XFLAGS_FSXATTR_MASK? > > Ah yes, typo. > >>> is the best solution, and suggested adding >>> >>> #define FS_XFLAGS_FSXATTR_RW_MASK \ >>> ((FS_XFLAGS_FSXATTR_MASK & ~FS_XFLAG_RDONLY_MASK) | FS_XFLAG_PR= OJID) >>> >>> to be used in the code/docs. >>> I'm not sure this is the best, but it would simplify reading the code. >>> >> >> 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. Another option for FS_XFLAGS_FSXATTR_RW_MASK is FS_XFLAGS_NOMASK_RW, which I like a bit more but I'm not sure. (Forgot in the previous reply) >>> Also, could we change FS_XFLAGS_FSXATTR_MASK to FS_XFLAGS_FSXATTR? (and >>> 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? > > FSX_IMMUTABLE > FSX_PROJID > > FSX_RDONLY_MASK > FSX_FSXATTR_MASK > FSX_FILEATTR_MASK > > or if FS_ is important: > > FS_FSX_IMMUTABLE > FS_FSX_PROJID > > FS_FSX_RDONLY_MASK > FS_FSX_FSXATTR_MASK > FS_FSX_FILEATTR_MASK > > or maybe? > > FS_XFL_IMMUTABLE > FS_XFL_PROJID > > FS_XFL_RDONLY_MASK > FS_XFL_FSXATTR_MASK > FS_XFL_FILEATTR_MASK > > or something else that is shorter, idk. > >>> >>> And at this point, we should consider all _MASKs to be frozen and only >>> 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 into >> 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). > >> 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 > >>> > 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 :) > > Thanks, > koraynilay > >> Thanks, >> Amir. --eefc83f33b94c9ec17a59381db65d891745fb0197d21a109a97cd9920e45 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSgVimKafU5DQMcjcDmj22qf5IGXAUCaw3qogAKCRDmj22qf5IG XKMFAQCApmbZqRCwqzmssimx7W7pTZHNLWr7DfklwGGbAJgp/wEAiGxhiVoyvy36 kqrx8lOtNLegl0QO8MSdiwNGd1O2OA0= =lVx8 -----END PGP SIGNATURE----- --eefc83f33b94c9ec17a59381db65d891745fb0197d21a109a97cd9920e45--