From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.49 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796567389; b=GaZNF7Tcj0JYMGyC4kk/ac0mXBWtFma+eMOHSuGmSsDC3NOBSlMqCu8kJhIRwVgAI6vT dNBtPd4hDHf3WxvKbz1wrUieZ0ZgXoBukzSVcjBav5M+wN6tjZYAogAiv6t78R9tlZ5y6 qe06/ZbzQTfCC9gHFZB3zkDy7wn7gPnIDaBTFlD3AgYH7vr1F6ZjeELfSLG8liQaQ5qUs sI4qlUoKofv623fjnXKxqaj/FQH5WW1dxgUfYmHEg9H0+RN83t9oPB0yqfDrGvu97WTcv x2lz0xNIEqFm1rkG2RpoU22QvgOh24fCrNme8hCv/PioHi/+JMEsBA5oRZgyQxZ4iPQ== 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=xXFpFy7uRaRfaoNtaBub4YwLpsV6qLsQhrM4nhCzCQwY1+s3odRgSV2nlTsfgSt9nvSM LwfmA8L1BLpBoyKq/5ZX+a7YdBXtF4MUOd8j/CsSnHMnMzwjHbl7AjxxwlO6tRYJu0rjR MAyi+nkDOZjrs1tR82uzE14+X+bGyIhe/rW1YbXr0Lgr9ZoUMFO7XDMzByPF75P+N8RDm D8PYAM/4e48M9ule1s/lBGoUIVw9sV054mcn7Y7xntndc7MKYSxUrU8NfQR1Jfujtkx1y dIp02Vo+vl81fkUySEW71vTNrI02X+Da5CVirIWLIMnVuT8BTbSZO/Ngd68SG28L70w== 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.49 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (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 8DA2C606A322 for ; Sun, 6 Dec 2026 14:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8DA2C606A322 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-f49.google.com with SMTP id ffacd0b85a97d-4a9be758734so1986691f8f.1 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=IP0fqXL3LqpiFlbv1ty9T2TfSOCZhFOSm3ogbxQwdvNg1V4h0xEhtu99TFpHd7NXlL IJ6vuMm5JMike6kjIQIpfDSrMu6IKXlnyHSIxV7Z6hBbo5qL8N3FRd78DnUHw51iKU1A cId2cyADM80jUDFrjYY8H95qGWmyymZxbRH4vd+JhLnKUCd4XB+Avq4rp8c1gI3ulqRb lAwsvJNLO2tAZlGOJ1x/TTBcGFs5Aqs5BKNKb8pLrqHjo72z3xCjACQTeStydL9lcWh8 CM9os/GjFvr/LuQ9OpIpu8CBus6/p5f9WphXe8Uo8VIT68twfeOkfybUGGXy86GI/tXn KCtA== X-Forwarded-Encrypted: i=1; AL+hErHvrox76bFdnn03z+Wu05nF6zWWa5ZGNimEJGv46BvPi1+AhmL9j6fMPQva7BiXdJdDB40gYPkKQLC9ODA=@vger.kernel.org X-Gm-Message-State: AB4q+uFgTMKDsYpXG7gbDIs/9EnkqnUOoHBhNfenSksBIVnPF0pVcXbQ sIb5FCSU2m4mex6Ckyo3OSd9k/8N9PAPKBxr8X3zeoWLbwf4lYj5Hb7h7OPbgSf02uk= X-Gm-Gg: AZFdTZeSTyTem4pnTrrzOtMN68BFdsBaUf246ZEoy+MWES1lVB6S8nbuGJgCkvoOWPY oKueGuwyw1jrNfKYE6/It4KoxNoqRSBTySSOMBfWn9MDUUjAXZ+/bKMbmm0YF1C/fLmw++HHmGj aCKUB3hu2dqBBe847woebBKqo6jeSWtPrWv278NxCf3HKR5tqm7VGu0SEKbzPLVVdsUfUGdxqxF Xmr+JeXtE4zx+mpbdJgfrHpX/2vp6QezpfZu8V8+F8+AcmlIERTNpkXAvw8ALza2Dc78qZrso1w 11QG2fK27WThv6EYiCGWibA9Ih5S6F9KUGdrF/2/izWwsQVoTWNCmz6ZnDvkUe4degopryjalyN XXrp7bnO+eSOcvQoaZrNk5TiJSYv9sze9CiMqSfN7AhMG9n2rC3edeKRgi69kNKOAeGOkNZz93h XLqpOba+KII1CHfNnmZTymzmujHpNrl5q5LHLF3IjVdDyFlqcimaEHXkMyyv/NawrpT2XWCF3XU vGWq44ivIpf6dXGuyvKJu0beLvxtsI/Ikngy1bO2T26Kex8eGAC4OHhcOw5O66OGFY2S2kb3GND xdwXqpA7isOKYLmaV982+vg7Dw== 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-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=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--