Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796577789; b=QQ8KGq99DGHbQ1WzQFAvzDCJLpMsk+jFRb44MapU6xGekD5rgX5PM+pcfwv4vWztpzKF qHgHgjBdB5gf8MstRGHTtcww23TK8OYQVx1DzARZVIfd5DaZxQ2gOKwXBs7+XzFRWFYzh as7OtkiZnMnhvU1f5Aun80A3IHINIJsDkASEnNkfy/a1iGyekplqbbvVP1koZrUKvfjnM QG+FF4AgmeMhmo3FaWzRzEGgtW471ZScgaLh1bbLDejhaCigTI0+0+xDczpWbUoELyxOG xM0yD5l2xheFXxXLl9IbZL8w918sNHL5CA04d9F0Bl2pVQ38PGiriUdRknDNwSMoibw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796577789; 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:Subject:From:To:Cc:X-Mailer: References:In-Reply-To; bh=Aqo+DVuaXFS4Q7eo5zDl/26rBM7MpmNIYml37TaSZCE=; b=jvy+xgwvz5OhzkWVLiYBU3uzJrt8LU9QpuVumbMuj/9ux2Epk3Si9BRiytH1dLsCNM5o XrR51FihL6SbGj37PKMUlEw88K+I37TrDYmzy4/FRN6qIcWpAZMOwkIaKbkI0WI35AUel lfjoHQjCpmyCyzjW/jgmtX3c07wiS9n66LF4BfN4HamqO4DYSai/9WLL1/inc4cYk2skr WqdDCejZgKD8vS1y7mRNYjY946h2qgR0KCbFjwWFikwlaUOBaLSI9m+JkumGdQczdAw3E WPKXE/zI6/XAdGfVKPMGh+DEfFVHKVPvHwVYfbYDoO8BDp7AvVotN0b7iSEBqSBwsWg== 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=oFZz5MH2; arc=none smtp.remote-ip=209.85.221.48 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 C7B1E606A324 for ; Sun, 6 Dec 2026 17:23:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C7B1E606A324 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=oFZz5MH2 Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-492690dd5daso1868488f8f.1 for ; Sun, 06 Dec 2026 09:23:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796577787; x=1797182587; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-type:mime-version:from:to:cc:subject:date:message-id :reply-to:content-type; bh=Aqo+DVuaXFS4Q7eo5zDl/26rBM7MpmNIYml37TaSZCE=; b=oFZz5MH209YoDh843k+KiInuJbpooJYqh5iHAUbuOWhAz5QO09ueTkgOfBlz0lXjQN MvNdJRLTZD91uT9oWO9UydWZiO3e51krr7BP2xcmATfOZmz6weGJKdDygVMAnnMTtwbf 0SmD0HDJIeyEBeVcLSH2wqQ00sDBnNOMYd+RA6MclBr0yqID6vMM3DPX4eBxqv6LuEFx oSdN5M2HKUbHXw51UfVlPde4jEcP+YXSnFREJBDg9O+1zmTAh9lp6fxbgFLUb8WRihto Mkb5GNVSSkAJz+azwIndApBryppc+pg45K+wI//gujVloqUoaBB28B3RfTYVCQp6PX3/ gC3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796577787; x=1797182587; h=in-reply-to:references:cc:to:from:subject: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=Aqo+DVuaXFS4Q7eo5zDl/26rBM7MpmNIYml37TaSZCE=; b=Th95+gKZmIzuGcbnpSJ5eL9Bm0dDOixT7PjwDLqs5AvwyC4LG0/i3Ma1+gcmKz0Eqk LQj/h0/zj9zr+VP5NHpxO1XlWhjS6pJg3KuJhaJQ7N4oB1MuR35U4denF+41yuFZv5G2 enHGxeJAgsmSaGOFamA9u24Q9VCFBPtEEfVSutGnjF0+pqpRKEECYLsIr0AY1F/pmYLv 2BxZLhG0vc8bjXC6rYGLbSJMaxyKg5nh2VKuBKZU8hU+qBrovKJonh7OZZhKh6zsr05d Vo4lmFXg28uu0Y/XgypPCfvWrjR3PHRHlu/MkGduIAFWlTHjYqGIQjCpVWsqYvGOcI9t 4log== X-Forwarded-Encrypted: i=1; AL+hErEiL5Fn8ClW/k4u/7PLeLG3HUt+ohqsKzvMAlSJ9lIpBgjCf4NpGPX6wpp6STp6VPy5BN89r9s10zs=@vger.kernel.org X-Gm-Message-State: APuU4Z+GteDgwZcWXIB/M/EXqJRmYQvFCypFjwpVMER/3ebCnEmMVfzL Ci8RUPgjLdFdB4GHA4An5bhUL4OmVtK86B0pNypw+biGlYHdzAlxOXyC X-Gm-Gg: AZFdTZdikXvRRYRUlXV48bEl9XnzOragcHRcKMEURyWyfkxtdONr1zcDpu2hj6ER+FS ZW7+bQc8Rvm3/gtA1x+9mkmdcUy3DtPWr/rgJg3vPMajXwaGAgbmcoYJxT9Jy0B8CadljM5TWul gN4kPpU2/hbgCF2MO3fsDoOOgLlGIPc1TDmUJRig3ZuUl6v86wmGrOMuSfdaeKSyQ5YFB3oZnVh fNhoJi9SFxnlfCUk1qooS0NBpKd45+kz6m8ZJzpuUoo9hNhlL+Iy1bpIv5PqDI56yWK09Hgv4Kb DcrAPYGX9ZeapP4qb6DAH/jXt32FvdJVDXjgRDXhL6vOiIPtRS/BRtY2gYDDqKmkrRfXSKM6N0B pKJ+bcHd0zNaFqreegEN0yZOc6Ca9BlFdnmhLECjxl6VNPuQiQXIdyn78uw2Eqe7729pPG4MlMn QkfX3WH6oYomeBOfAwGwuJj9B/cSAoHybjIYWC3Bzev7IdEp6/8/VmV4w0Twf8k6THJi6TQky5D y5hfH1YP0fNhf5LRX+VuOjuoj4VU7rgUt/wCC0hnXF/ozjqM/OGgEocNY9UxsE5CZvLuv56G2c5 L1YKcOWzZnBi9ScR3dbGSMaYyA== X-Received: by 2002:a05:600c:3e07:b0:4bb:6ac0:6dc1 with SMTP id 5b1f17b1804b1-4bbeb6eedf1mr153096905e9.2.1796577786970; Sun, 06 Dec 2026 09:23:06 -0800 (PST) Received: from localhost ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbf17c68f0sm91720495e9.3.2026.12.06.09.23.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Dec 2026 09:23:05 -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=668a736fb5304f833f0f1bda70cdaf39ce504a0aaa4672d0ee6520d1fff1; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Sun, 06 Dec 2026 18:23:01 +0100 Message-Id: Subject: Re: [PATCH v5 08/12] fs,overlayfs: add fileattr masks support on get From: "koraynilay" To: "Amir Goldstein" , "koraynilay" 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" , , , , , , , , , X-Mailer: aerc 0.22.0-0-gc2f86b7abde3 References: <20261205142411.164484-1-koray.fra@gmail.com> <20261205142411.164484-9-koray.fra@gmail.com> In-Reply-To: --668a736fb5304f833f0f1bda70cdaf39ce504a0aaa4672d0ee6520d1fff1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Sun Dec 6, 2026 at 6:11 PM CET, Amir Goldstein wrote: > On Sat, Dec 5, 2026 at 10:42=E2=80=AFPM Amir Goldstein wrote: >> >> On Sat, Dec 5, 2026 at 3:25=E2=80=AFPM koraynilay = wrote: >> > >> > Add transitional get_only_masks selector in file_kattr for filesystems >> > that want to advertise their read-only mask on GET but don't want to >> > receive masked requests on SET. >> > >> > Use it in ovl_fileattr_get() to ask the VFS for unmasked SET if the >> > underlying filesystem returns masks on GET, otherwise ovl_set_protattr= () >> > treats fa->flags as the full set of flags and clears IMMUTABLE/APPEND. >> > >> > Signed-off-by: koraynilay >> > --- >> > >> > Amir, is this commit message correct? >> > This is what I understood, but I'm not 100% sure. >> > >> > I wanted to mention the actual bugs fixed, but since I haven't >> > understood them that much I didn't want to just leave the robot's >> > explanation in the commit message :D >> > >> >> It's ok that you framed it as an API patch which ovl uses, but in fact >> there are no other users in-tree at the moment, only a future one, >> so we can frame this the other way around, as a property added to >> solve an ovl problem: >> >> ovl: do not accept masked fileattr set requests >> >> ovl_fileattr_get() reports the real inode's masks as its own. >> When the upper filesystem supports masks, the VFS would send >> overlayfs masked set requests, where fa->flags only contains the >> flags selected by fsx_xflags_rw_mask. >> >> ovl_set_protattr() treats fa->flags as the full set of flags, >> so for example chattr +d on an append-only file would clear the >> append-only flag. The VFS CAP_LINUX_IMMUTABLE check does >> not catch this because the request does not select APPEND. >> >> Add a transitional get_only_masks selector, and set it in >> ovl_fileattr_get(), so the VFS converts masked set requests to >> unmasked set requests before calling ovl_fileattr_set(). >> >> Reviewed-by: Amir Goldstein >> > > On second thought, after seeing your answers about failing overlayfs > tests, I think that overlayfs should not report masks at all, instead of > reporting the masks of the real inode with get_only_masks. > > The masks of the real inode do not describe what overlayfs can do: > overlayfs implements IMMUTABLE/APPEND itself in overlay.protattr, > does not allow changing CASEFOLD, and before copy up the masks are those > of the lower inode. This would also take care of "bug 3". Ah, nice, thanks. > So in ovl_fileattr_get() something like: > > /* overlayfs does not support fileattr masks */ > fa->has_masks =3D false; > fa->fsx_xflags_rw_mask =3D 0; > fa->fsx_xflags_ro_mask =3D 0; > > This should be done in the patch that introduces the vfs interface. > > Then, this get_only_masks patch keeps your original v5 commit message, > without the overlayfs part. It should document the future user f2fs with = a s/f2fs/ocfs2/ ? > link to explain why it was added without an existing user. Ah ok yeah, I'll add the ocfs2 thread link to it and move the ovl change in the vfs patch. Thanks, koraynilay > Thanks, > Amir. --668a736fb5304f833f0f1bda70cdaf39ce504a0aaa4672d0ee6520d1fff1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSgVimKafU5DQMcjcDmj22qf5IGXAUCaxWZ9QAKCRDmj22qf5IG XKHvAQDeWJtbFhcRcZoW4YB1TcDe6ZVF9U188dhuJDwf85VX3gD/UKv9OPF7qIIH EuDLyrIHxgRrI2XSHrZh7zleG0xfeAA= =sGcO -----END PGP SIGNATURE----- --668a736fb5304f833f0f1bda70cdaf39ce504a0aaa4672d0ee6520d1fff1--