From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796567389; b=U+AL+99zb/WtC3DPmlVa1hPbc/jm3V8LwnkFe/XRJZJLWUfj67Pis4nUOijAOXo1nif/ W7NfNjA6FmxcrLv6yU3/tp51oyjPblm+75QlkTkKCSq0p8njDERkF1kycQGMV+XsRg25O /3Hr5B2n/ljfA81i5TgJf3MrpYFbONxe4jluS0gpbFtWS1Ls7+UN5MiNmIxvvKFAA3+Zw XoScjoxXbkWUANsFapCJq+pY9Z/A1YO1BKvrc1QiMktwnfwLUdom6I4CKfE2BHmQ2ClU1 4ffEm8hGA5e30kFLVOXQRqDgwR/eTaFn1RJG6qILOtQaYiZL41580/qK+hhuSv85SWQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796567389; 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=DjKqPUPUJXAtCzzV8pMJFqZ0uOiJrtOJaXOmAJJ4ed8=; b=hbL4SC6nC+SPlziVLTW2C6ZmxlHTRH3d+eMbpq2VJH9ektUv4hkjOKJSJtcdcYa7rYcZ 2+pkcY8Llvervu1W5C0GpQoDZbHyTvVrv1FrhxmwV31Z1gN1MHNEtkUsKgjrX/pUR0Wmq eKun6Uqm1yMvnBEsVN4HC5Pz14WUxdsFz6Ya+Uep78R/1AbfADl+BT6rgkaj+GwkhiGVM hz9T991M00hjxUGHYRd48oJdw67g1OKgAzBb5g6V8sakvJkXp+JXdiii54lgWIj5vWYlI JcxnBWd8S456qLp65GE7DQ21cOmOagZW0BWZMULGKpEzrD1wwYkqQ6VH7gnmGJmF32g== 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=r3kvn2+v; arc=none smtp.remote-ip=209.85.221.51 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.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 94231606A330 for ; Sun, 6 Dec 2026 14:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 94231606A330 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=r3kvn2+v Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-4a357b1c649so1402011f8f.3 for ; Sun, 06 Dec 2026 06:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796567388; x=1797172188; 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=DjKqPUPUJXAtCzzV8pMJFqZ0uOiJrtOJaXOmAJJ4ed8=; b=r3kvn2+va/0vIN15MJfj05SKSnUtYRTcQsbQI1vwmVptjO0+rSJzwsGe9Zd+TvZOWU fgH0puhqJRawfH+DgdBbmmpK6StJ331rzy/dpUsh0BX8M+3PLHpTvN6R10RlUnKTFjwW ljVJnuYBr5kTrgMgIoYRMJ9j5OIoc7Z08MNQ9li3mpwJDPZrDnEK1UxgIe0901ZVZx5P 1k77CIpcjFLTuArYq5XF3v5r68k64W0A0vNkaEICZKda7+VozUlO06D9a2nAtV99Qztv hECUndCF9HHIgM7/RXnaiNwOj6XweTqXQIsWEJ0nyfeuQU5ibK60AcV6uZLxhdcz62A+ 6F4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796567388; x=1797172188; 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=DjKqPUPUJXAtCzzV8pMJFqZ0uOiJrtOJaXOmAJJ4ed8=; b=1lbgYl0JdwKkZKkU+K62c5lY6vsWXQUem1PA1dun0YP3uZtvh76HE68CDcsrDbRa+E yw+IJI8+vbl68yRxpM044qQGAXZPogOPRMLpxYhafCjj2OylyWzshkxtKtb5uq2HxT2c aXSBcsg9Qf31YCdBTKTLo+JZ31aqOoU/rmuQ81rOHLjxiAeDE+A8CWOuUWRme6RAoRxn 3DIoHj6spQM2lzcHy4b13aKYGCmIxnwS6swHdfrR5i8zQCwxXukZDKTM3MgzLiMqzmjv 23LcS871HyiGnDlh9p4m5KD5j+apDIxmvkdQwDbTHCt06rh3wL9tJY43j1ucuu5OA+LP hCrQ== X-Forwarded-Encrypted: i=1; AL+hErEfQaOxVHCiP1NXLe4kZswZsD3dPt1yb8ijTFyPD/Rw5q8wkFTX59hmdwam1DGBT4vQsomko4zIbho=@vger.kernel.org X-Gm-Message-State: AB4q+uGpCYBMaiX5Aak04fRJcpChuNmH0mW1MaUH3cI1cFepwGfaOv0T 2N3LeIUgw8LdAKitIpCQEUbJ6E83GmVf+pfs31jaCm6PhWq6iZN888UA X-Gm-Gg: AZFdTZd23v2TKElVZ+FqJL85twcQ7prmXSrSNr6v1T73g+z4ZC8aTPSVULUtMNCBCzb ixyuHiEuJZhslwqRtt2DTlZ49G0mhEgnIf7OxkXPXlDGBEoW8ZKvCULGHA+d5X4aGHaUNxi5+5/ sxt1fkl0VbJLQ4b9uwyxlf8eCDbL+Iz95hMKuq7hkWiBabHhWSrnl0ruLJpCsaT37MFVUKZQC3I Z/ZIhcNtJktIvx1YAukGIzMAR+CwjQYsWOL6FVnqgCt4ar+3EurB/HgrtWCbuSJW9IaWZm7GT7L lLRnPf0kxc+Ee5QHWr4CpC+D9O755cRdqmnitQ6uG3NHowDVUqy6P807khXz9uaqTrpYiSCqUrd 94B8Qy5wHkGws1+mIbJZ5Ie707CLOm7xJNbsDqqknCIWPcV7kUElBTnoszjPFl80yMBc8lG8VKW W8FrFCOeFIY8Hmxf0XTDf6obJGux7T9rjLfSWX0sJk8CmuaSbnsu47nx4BmM1PQmVfFDB4txhoF PmZ3DGddEM4tJB1IZrvgk1o+U0oqAixhfdXUWYZ/j7E4HelPd5R6lTyDcNy/CcJbZnoieYHvRAG /krk70ZFHDnQbrYzlwX533BQ9Q== X-Received: by 2002:a05:6000:2b89:b0:4b3:71c7:42bb with SMTP id ffacd0b85a97d-4d1e8dbce66mr9927899f8f.19.1796567387740; Sun, 06 Dec 2026 06:29:47 -0800 (PST) Received: from localhost ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d174d08d42sm16730155f8f.55.2026.12.06.06.29.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Dec 2026 06:29:46 -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=c4d8628c26869009fce83ea5a937ac2036bfc2afb8a38f520889e6215919; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Sun, 06 Dec 2026 15:29:45 +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 v5 05/12] fs: add initial implementation of xflags masks to fileattr API From: "koraynilay" To: "Amir Goldstein" , "koraynilay" X-Mailer: aerc 0.22.0-0-gc2f86b7abde3 References: <20261205142411.164484-1-koray.fra@gmail.com> <20261205142411.164484-6-koray.fra@gmail.com> In-Reply-To: --c4d8628c26869009fce83ea5a937ac2036bfc2afb8a38f520889e6215919 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Sun Dec 6, 2026 at 3:12 PM CET, Amir Goldstein wrote: > On Sun, Dec 6, 2026 at 3:05=E2=80=AFPM koraynilay w= rote: >> >> On Sun Dec 6, 2026 at 2:22 PM CET, Amir Goldstein wrote: >> > On Sat, Dec 5, 2026 at 3:24=E2=80=AFPM koraynilay wrote: >> >> >> > >> > fs: add initial implementation of xflags masks to fileattr API >> > >> > "initial implementation" is too vague, this patch implements >> > the vfs parts of the fileattr mask api so just say so >> > >> >> Add read-write and read-only masks to the fileattr API to let >> > >> > to the vfs fileattr API, to avoid ambiguity >> > >> >> filesystems advertise their support for specific xflags, like >> >> statx.stx_attributes_mask, and to let userspace specify only which >> >> xflags it wants to change without needing a RMW cycle. >> >> >> >> The masks have the following semantics: >> >> - read-write mask: >> >> * for filesystems: advertise which xflags they support changing >> >> * for userspace: specify which xflags it wants to modify >> >> - read-only mask: >> >> * for filesystems: advertise which xflags they support only reading >> >> * for userspace: ignored >> >> >> >> And they should be filled according to the following: >> >> - GET: >> >> each filesystem that wants to implement this new API fills the mask= s >> >> according to its supported read-write and read-only xflags, >> >> then: >> >> * for boolean xflags: it fills fsx_xflags with the current on-disk = value; >> >> * for value xflags: it sets the xflag bit to 1 in fsx_xflags and th= e >> >> xflag value in the struct field; >> >> - SET: >> >> userspace fills the rw_mask with the bits of the xflags it wants to >> >> change, then: >> >> * for boolean xflags: it provides the xflag value as a bit in fsx_x= flags; >> >> * for value xflags: it sets the xflag bit to 1 in fsx_xflags and th= en >> >> provides the value in the struct field; if the xflag bit is set t= o 0 >> >> instead and the value is 0, this informs the kernel to unset/clea= r >> >> that value (if the value field is non-zero it should get rejected >> >> with -EINVAL). >> >> >> >> To achieve this, add fsx_xflags_{rw,ro}_mask fields and {has,use}_mas= ks >> >> selectors to struct file_kattr, so we can know when a user of this AP= I >> >> (userspace or filesystem) supports them. >> >> >> >> To eventually make both non-masks and masks programs interact correct= ly >> >> with both non-masks and masks filesystems, add: >> >> - fileattr_set_{from,to}_masks(): convert between non-masks >> >> read-modify-write API and masks API; >> >> - fileattr_set_convert(): handles calling the above helpers as needed= , >> >> then calls fileattr_set_preserve() if neither userspace nor filesys= tem >> >> has masks. >> >> >> >> Note that this is only the initial internal VFS implementation: it >> > >> > Drop "initial" >> > >> >> doesn't include any changes to UAPI yet, nor does it include >> >> FS_XFLAG_PROJID, so with only this patch it's not possible to set the >> >> project ID using masks. >> > >> > odd remark - user cannot set anything with masks yet. >> >> Should I remove this paragraph altogether or change it to something like >> "Since we have no FS_XFLAG_PROJID yet, return changing it as >> unsupported"? (or something else?) >> > > I think removing it is fine. I don't see what value it adds. Ok, I thought I had to say something about PROJID since it gets rejected in this patch (because of course we don't have the flag yet). I initially just wanted to remove the projid handling from this patch without adding any special cases, but the bot advised on handling it anyway (hence the return -EOPNOTSUPP for projid in set_to_masks()), which makese sense so the code is "complete". Thanks, koraynilay > Thanks, > Amir. --c4d8628c26869009fce83ea5a937ac2036bfc2afb8a38f520889e6215919 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHQEABYKAB0WIQSgVimKafU5DQMcjcDmj22qf5IGXAUCaxVxWQAKCRDmj22qf5IG XIYRAPj4jdlzT0jhLD+BT+G8B7JkX+pVADnt5oyqPca426upAP9o86oMjkW/zkYm /OI7aMHZdMOrRwWq+YEKKY6s+s/LAw== =vUK6 -----END PGP SIGNATURE----- --c4d8628c26869009fce83ea5a937ac2036bfc2afb8a38f520889e6215919--