From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796567390; b=MxPNtxJY3RCg7QyyanfEm/Bpiij5XQpfZ0IudAuEHgSrcWNkxpydiopkoQBqMGPRDIa6 NUkRF4Pp43wMQzWf7azyJwfqCpYcw7KwZsFpLknHyrSMea8KytuXHYSPQV9kRGe1GrD4P +JQHZNZPLn4HhWYzUIF1CTe3tj3YBgtwPjsUlqh5lcnEglYdl4h/bZTq22Xnf6T2O4U3W B2xwUMw/f3DqdiWD1/fXSJQVD9HK1lfhFeFoDc8OcS+LNaF0orrXWnCfkn5bScvaUcMr1 I6TZlb53KILEc4b7z1VCF4kACGr2z5ExVptw6//DyuRRlQZp0aM5Q0tccLCRb8MRE/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796567390; 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=2svN3Dw8HA43Md1mfSl/xq1fe+DRy1IU/slE+a9LrLeBUvZEbqOU9mkwA6ewvbX7GAs2 wKwa5clm+pUrc+lOfF30a7Tthzb9UQlzR0fcTbIV3AQyWi12tZu71JE/mGGceJB8TYkoP wbtVflEdOsccrQz98yJocq8uZVZetVvtZ4CPlQuTGTmSQDXW4OuMH0EH1X6nGbnKFrAGQ Ts9VAlZ2ET1+mQQoYVR5xeRepBghKqmVNbLHhBx+T2ZNxqAqWmYvrUGByN7ugFnfnJRQR FWX5jcrxBBNgZsc2Vb3krA7Oa1fr1mg/4k7op1JOLoSYvOeW23+W6c0juwOJofmylCg== 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.50 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.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 B903C606A332 for ; Sun, 6 Dec 2026 14:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B903C606A332 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-f50.google.com with SMTP id ffacd0b85a97d-491f34b4e0fso1009845f8f.2 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=cyh1tae9rb7EUpbQROtWLbzuFOCTfX+NG03CWSWfdtPQWaqOD7UgnH1bmlMLkTag6Q dlvvNHUfJ61MLTwNNJNKBByj6/vLrZ1JWgErM8p4CUuDada3JYq0RG+Tv1m+o83XR+ON FQ48Izkl+S3/r6K84nylgo4vHUA+qNsNsihH/Ruff4f/7g8ec+477eDfHvIveNQEtdjM ikcRyhXWSpjJLkyrF0Fj/Cm+BwdNk0v0Qp57hNUuuBMyyhCL8IKW3ScYKxe37Wf8ILFz jl5/xktpQ/gi9lfExI18wXCff9vKSuVSo0CO6cgBLbDuvfUL/nj3Vst/yARCTmtXUv8w 2Mog== X-Forwarded-Encrypted: i=1; AL+hErFyQfILKgFSszlKIrRBr1PUnTvkNILS3Xe5VAUO09Ww+FTwkrmrvYuVh/FU19NQrjQtu8bIfp8WbXgCg4XE@vger.kernel.org X-Gm-Message-State: AB4q+uGhm+AJUnDcyt3l695SCPZ414XRuBy+5/XwoN7fg9bsVbXgGsbQ sfcUVOwr80ei5mqX8QSNW3rbcd65mgMZ7zu/Mwov+8UsEHOlSU73pQVb X-Gm-Gg: AZFdTZcqxfqTFLW/ycfhPF5AsmwZTmIMp9nUqYEPbM7088MWyTQywo4NJ4hI9922o2T 9zf7eVUYZZDqYAPtzO+oiQ1SO3W+6ObeqKH79dt5jos1ctKz97rmtvt6wTq49hH8Tqx2+9tb4fw Q7SBVvqBOrSfBn/FWRrasW31MykMMHKJMoHjh9VHhxQ7FH5YEObAx2/e+3zEQ8KTzdy2Qe+EUxI iXCvcfjJV1058MCRwAqtr5cUQbk+qMfevg15HRq7hsmnt+PXeKXtDDVAaeFcnODeTtQEAQhUyxj XFmq9QyenBVVO57eHvkP/sMk9kFv1jOiyUfJr0Tgd+oP+xs2iJJB4Q8eRYpF1r8Awtvn3ll4VgD KoCv9mF1cy1dhu0DyBRyJ1VvfmQH8M7Wd4gIVNy6i+LpMQn3KRmA7SfEiVheHMa0hqQMEpqoqcx J9o8fwcfqW8f0o1TCBapDslcrwfTPkvVRnXJJI4Gll2Z86WJ0A6mLKmwgA6zIQZ1MxQ6s2b5vqf e5j3EvSpzapiaSVYEyY8qo34ATxIqeQcCVNlfOBcr87NQaqeRrkwGJDbq7IB2njoZk/DiiY40vh PaA48AioMYDCYlDe2WY+m3LtsQ== 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-fsdevel@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--