From nobody Fri Dec 19 20:55:25 2025 Received: from outbound.pv.icloud.com (p-west1-cluster4-host11-snip4-9.eps.apple.com [57.103.65.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96D33294A01 for ; Tue, 15 Apr 2025 12:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.65.220 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744720498; cv=none; b=kMdOWcTK3I7RChPMRH1h2S0dGn2ruURfxl/TXiLLAved7jkFltO/O4sejD9azo5Tfy4ciwAKMdHsDcZH8sBxQ6qS4MDgAx6M7CfkijAat9+vsx2KwX5kLM2m1AmiE9S3M1S+dkUgk0OYRJ1AuWwPKJbj7eAnitufgg/e4GWkd4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744720498; c=relaxed/simple; bh=XdLXjUpy2m8ByEWtaWtiNabdg6hygFifDVArr8nh2pk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RQVRh+7GX124AiwFll0ATC5GBeIyLrpDRZckVitWFrW11d2cPUD0XzIGBQeO64gYSlbMIitf4phZXB7CTvcxaPm2TtG2MSl8AszYtvZHFJzbBsuY4NH7jOEGpB/kFmErSsV9cS8hRi3jy0KN/Emt61neySPhtnF/CGaijM07ULo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=B45R08Is; arc=none smtp.client-ip=57.103.65.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="B45R08Is" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=M0kOlRjIFA0XuH1Wq2lDYX/r1k5rk0w9a3TwvzRsiOc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=B45R08Isyvdm8iiO22uhPdQtMIObC2qLs8nHhM2xN4ga9qstJDfo+GrRzygii5jgj QoomZ1SXO5PM9imBqF+uy4LdNvSx4pN5DiEzceoSj9jdTYJlOt4BPu+vBYTFAhE0Fi CQUUlvZUMxS66OaP278FuWp9tPjJNmb3SbXMJ4oR9bhymfSF+Bc7+cP/nwG300Dekl KjaucUYaLofMG5XJYhU/L8oGpO3l2VzYe8LI8BsiR++mHNRTnq/pGc+0EIY9aDwtKP hC5h4IzBUigWoKaHh475DKfhwaYa6cKmv3KL58FkX2NUYydsniiLJTp5m/J/V0GuJZ zO41KkX9RUe1Q== Received: from [192.168.1.26] (pv-asmtp-me-k8s.p00.prod.me.com [17.56.9.36]) by outbound.pv.icloud.com (Postfix) with ESMTPSA id 9FCD5180194B; Tue, 15 Apr 2025 12:34:53 +0000 (UTC) From: Zijun Hu Date: Tue, 15 Apr 2025 20:34:25 +0800 Subject: [PATCH v2 1/3] configfs: Delete semicolon from macro type_print() definition Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250415-fix_configfs-v2-1-fcd527dd1824@quicinc.com> References: <20250415-fix_configfs-v2-0-fcd527dd1824@quicinc.com> In-Reply-To: <20250415-fix_configfs-v2-0-fcd527dd1824@quicinc.com> To: Joel Becker , Pantelis Antoniou , Al Viro Cc: Zijun Hu , linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: p8Bdpp3dflOvXKSWYsSj1EoDZKacrunE X-Proofpoint-GUID: p8Bdpp3dflOvXKSWYsSj1EoDZKacrunE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-15_05,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2504150089 From: Zijun Hu Macro type_print() definition ends with semicolon, so will cause the subsequent macro invocations end with two semicolons. Fix by deleting the semicolon from the macro definition. Reviewed-by: Joel Becker Signed-off-by: Zijun Hu --- fs/configfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 7d10278db30d667d0ef7e1140e54961c5a440c41..0a011bdad98c492227859ff328d= 61aeed2071e24 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -970,7 +970,7 @@ static void configfs_dump_one(struct configfs_dirent *s= d, int level) { pr_info("%*s\"%s\":\n", level, " ", configfs_get_name(sd)); =20 -#define type_print(_type) if (sd->s_type & _type) pr_info("%*s %s\n", leve= l, " ", #_type); +#define type_print(_type) if (sd->s_type & _type) pr_info("%*s %s\n", leve= l, " ", #_type) type_print(CONFIGFS_ROOT); type_print(CONFIGFS_DIR); type_print(CONFIGFS_ITEM_ATTR); --=20 2.34.1 From nobody Fri Dec 19 20:55:25 2025 Received: from outbound.pv.icloud.com (p-west1-cluster2-host3-snip4-8.eps.apple.com [57.103.64.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDB831F3FE3 for ; Tue, 15 Apr 2025 12:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.64.239 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744720503; cv=none; b=JYi5FNSec/iHh0KqeZXkUCpkH7pfHXnPh2S2CoxygoxpsNRyLHt+FxQ1YDbMPV4ykZPznAiVnAMH38ANjB0fTuC9QtSkGbcABEYJfd9OipODLiUTz0+bkWB0NuBRr8D16XkxabF3gutQYBtaRPtuWgaoHiASCE+WOcSr79QPalA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744720503; c=relaxed/simple; bh=55telB29pwujf1LwMv4On5EW/95s9rStxrqjwR1k0oo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CgsRGnT4/1rcPce0TvYyXP5/4vyceNn73L5lN68z+NTTsn9fmNx5oWslb5E+vLzmKvKl2fjPAPCODfw8vnq/IaO1IZb0X43iRiDOekcdzcu03G3cww/2z4+wyjq5QzU3kVLq63F2nHdGtbbpUg7AhTnnBPPyKe9d1K+A8Vd3n1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=H3ivcqqU; arc=none smtp.client-ip=57.103.64.239 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="H3ivcqqU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=QxSHgt6aXuLJk8a5NsbjHD+ZecG8WJ+FsLv+31TleOw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=H3ivcqqUHXBLH1MBdqXJ4/Y1vxsSVx/nFBLtdgablHQjFfQWS8bLJDNPWGq/Iytci g+x3UumyNtT9lNHu9BLm3Tw+cLHft9hRfQw4cgXlL/yYHE3kUCaqQuioS8nm5+0Bnr +m7D1XF0dh1kKTVnB36ciu3gcKPcUYQN+V/sAyFq0Mwkp1quuR217B8InY77Bko3Nu awYCppr4+ScfGAxbaj6KR/CNFxogx4kDl+/IQJOvJhRUjnNzUZdsZ/Dtkdo4zvZZ9a 1dHSCTjaa+qCvfFTt206SOB5nJYOq9IKi7lFvTSc9uUKXSzOzRd9QTRbLHNFonk9JY psVQb9J4rZchg== Received: from [192.168.1.26] (pv-asmtp-me-k8s.p00.prod.me.com [17.56.9.36]) by outbound.pv.icloud.com (Postfix) with ESMTPSA id 7548A1801959; Tue, 15 Apr 2025 12:34:57 +0000 (UTC) From: Zijun Hu Date: Tue, 15 Apr 2025 20:34:26 +0800 Subject: [PATCH v2 2/3] configfs: Do not override creating attribute file failure in populate_attrs() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250415-fix_configfs-v2-2-fcd527dd1824@quicinc.com> References: <20250415-fix_configfs-v2-0-fcd527dd1824@quicinc.com> In-Reply-To: <20250415-fix_configfs-v2-0-fcd527dd1824@quicinc.com> To: Joel Becker , Pantelis Antoniou , Al Viro Cc: Zijun Hu , linux-kernel@vger.kernel.org, Zijun Hu , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: PfTiURAdio8dfn9ydI5NecXYE0RTaeA6 X-Proofpoint-GUID: PfTiURAdio8dfn9ydI5NecXYE0RTaeA6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-15_05,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2504150089 From: Zijun Hu populate_attrs() may override failure for creating attribute files by success for creating subsequent bin attribute files, and have wrong return value. Fix by creating bin attribute files under successfully creating attribute files. Fixes: 03607ace807b ("configfs: implement binary attributes") Cc: stable@vger.kernel.org Reviewed-by: Joel Becker Signed-off-by: Zijun Hu Reviewed-by: Breno Leitao --- fs/configfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 0a011bdad98c492227859ff328d61aeed2071e24..64272d3946cc40757dca0631908= 29958517eceb3 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -619,7 +619,7 @@ static int populate_attrs(struct config_item *item) break; } } - if (t->ct_bin_attrs) { + if (!error && t->ct_bin_attrs) { for (i =3D 0; (bin_attr =3D t->ct_bin_attrs[i]) !=3D NULL; i++) { if (ops && ops->is_bin_visible && !ops->is_bin_visible(item, bin_attr, = i)) continue; --=20 2.34.1 From nobody Fri Dec 19 20:55:25 2025 Received: from outbound.pv.icloud.com (p-west1-cluster1-host1-snip4-5.eps.apple.com [57.103.64.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A86391F3FE3 for ; Tue, 15 Apr 2025 12:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.64.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744720508; cv=none; b=UwBqrPh+oDuGNiMcFBk5B6D97nd6l+z+DSLbLCNZtON9MsWKbh6d6qpRHHregKuk3UWIn117QBI9i0CYcWEhFeyMWppF7M/IPxpNPyGIEcy8YcBeixKMMAdGjjNcLA8UseULiJnx8wZ4DIqjnlWLaJdTlGlRPa6hmqBOXGjzdeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744720508; c=relaxed/simple; bh=G/M1tHMiyflA1BIJylR3XZVvTrp1OCa6G+q+3ZYF/KE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qqBSyTjbTWK5CRgn+fMD6CSfiA6Zd+8wD9baFatIXiHlK5f2taM15pqS6fX/GBnPAm8Vr3FLqNj0+c5pmXjUbsTe/ieJtF4tSyvGTgrpKILc+mBW1WmfKN93+lsttL8AbgC9iS/4za7VkBH+pdQDJNhNiaWxf/paIr+dHvmomXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=gPGaRBlg; arc=none smtp.client-ip=57.103.64.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="gPGaRBlg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=As/+adlLHJw9d2MVZPc0TJBJ1JrIgfvJpyt5YhiILdk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=gPGaRBlgIGtmpNBrvNT04nlqnZf1ioTVCqG2P/ZAHF1rgjrkenlxt2GizRM0mxp8I 8ylFmllh/44V+fTJgEnQ74bvjSq4An2Ou+MflRUmF1HiM1YlPbC+/lxqzxYF0Joe5F KZgNg+DiPh0NknoJZxFxC24sN6P3ULlBCVNT7AQ43eWMdOBofPUlpvEtEwuK65lBPu Jx3bGmd37N2AZAkkvPDLqEcfdpoCvatwBAbtl9JOG/TcIVBl8HJWsRhNlSCs9AOj9i k0Vn9GWpRHesQbXEXVNLcBjILjiwLbQYR0r2iBw2Nj8orrYhfzotoAZgVZnE6McqZP kyC+W3jEIa2uA== Received: from [192.168.1.26] (pv-asmtp-me-k8s.p00.prod.me.com [17.56.9.36]) by outbound.pv.icloud.com (Postfix) with ESMTPSA id C05561800413; Tue, 15 Apr 2025 12:35:01 +0000 (UTC) From: Zijun Hu Date: Tue, 15 Apr 2025 20:34:27 +0800 Subject: [PATCH v2 3/3] configfs: Correct error value returned by API config_item_set_name() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250415-fix_configfs-v2-3-fcd527dd1824@quicinc.com> References: <20250415-fix_configfs-v2-0-fcd527dd1824@quicinc.com> In-Reply-To: <20250415-fix_configfs-v2-0-fcd527dd1824@quicinc.com> To: Joel Becker , Pantelis Antoniou , Al Viro Cc: Zijun Hu , linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-ORIG-GUID: 7Lc8Zxtxo7UzqSnos6E459TYESyTzkUd X-Proofpoint-GUID: 7Lc8Zxtxo7UzqSnos6E459TYESyTzkUd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-15_05,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 spamscore=0 clxscore=1015 bulkscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2504150089 From: Zijun Hu kvasprintf() failure is often caused by memory allocation which has error code -ENOMEM, but config_item_set_name() returns -EFAULT for the failure. Fix by returning -ENOMEM instead of -EFAULT for the failure. Reviewed-by: Joel Becker Signed-off-by: Zijun Hu Reviewed-by: Breno Leitao --- fs/configfs/item.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/configfs/item.c b/fs/configfs/item.c index 254170a82aa337d95cbfbdf1a2db1023db3a2907..c378b5cbf87d28387a509c3cabb= 93eccfb520c9c 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c @@ -66,7 +66,7 @@ int config_item_set_name(struct config_item *item, const = char *fmt, ...) name =3D kvasprintf(GFP_KERNEL, fmt, args); va_end(args); if (!name) - return -EFAULT; + return -ENOMEM; } =20 /* Free the old name, if necessary. */ --=20 2.34.1