From nobody Mon Feb 9 06:31:10 2026 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (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 008B42B2DA for ; Tue, 8 Apr 2025 13:26:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118797; cv=none; b=h9jwtXpaHJDJ2c7De7HtMWJ9j7OvpEa61RNT5i+tSvNsnBS04eNQfyYjOHMdPiSvF8f/2E7lEWcr9B3vlTTe4xtD3QTMr7pVjpQ42up5rSLe2GNO3EuYhW49eBEgcrmbt+St7NqvdfapdmuYz7hFfphCpu9VRb6t+s36/17nm/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118797; c=relaxed/simple; bh=9fsTAIVfOi0+OWNIf3tIMuaBLuyIGt5oDhLJusCehnk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A9JWaJCToz7GzL4TK8rQrBy/6PCPSB1P274jVq7juapkju1ymndBEneJ+0CqTNj/foDe9r7ZXpgYedre7RcFufdqZ2YVfZmgnWhb+82i8prFViEg8nzDLPpiQuNaaZID+5ve3cDMc7FCAv8Ag12sT+9dcjMdyIf6b60HKN8SsA4= 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=F45wA7OG; arc=none smtp.client-ip=17.58.6.42 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="F45wA7OG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=2daTzEuq/qfYre6VoZilPcn/8mf1QnnXEd8ixceQqyY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=F45wA7OGkXCiMEKLmgM7iu65iJjA+/k2Cko8gQch225ANWtLEhOa6gm/dADbkuKs9 /UilOo+O82QO1hJuejdNsA6cfg3Dd+i5/nGxhxnfh4SJyzRDTnPmD5wNDEd9gZn+Ln GN0jHXZaFbh8tXYomzZnfd9DTMVkns6+YKZ3gSiQFkXo1zgQHeeSEoBoZVAxt4r3ix gR1u4KdtGDjICzm0N2fDQMB409BWfSIQq4tMBy5eY+1pN8j2b6H7lkZT+YiHwbLAf4 34otY2/uNtOG6uBtfE7050C/9VMAqmmTRnY92vuyY/lYL5wHLi8Y/2YvaEb3noeTbz jiXLtTabztJ+w== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id 769004A03A1; Tue, 8 Apr 2025 13:26:29 +0000 (UTC) From: Zijun Hu Date: Tue, 08 Apr 2025 21:26:07 +0800 Subject: [PATCH 1/4] 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: <20250408-fix_configfs-v1-1-5a4c88805df7@quicinc.com> References: <20250408-fix_configfs-v1-0-5a4c88805df7@quicinc.com> In-Reply-To: <20250408-fix_configfs-v1-0-5a4c88805df7@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-GUID: Jfxsi825eBVZpNvvu7u-YxPgcy1J1CUn X-Proofpoint-ORIG-GUID: Jfxsi825eBVZpNvvu7u-YxPgcy1J1CUn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-08_05,2025-04-08_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2504080095 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 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. Signed-off-by: Zijun Hu Reviewed-by: Joel Becker --- 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 Mon Feb 9 06:31:10 2026 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (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 1FCE186358 for ; Tue, 8 Apr 2025 13:26:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118804; cv=none; b=mAxJIjk65Z60QHDXWFdtXZCtRg2iQLbH3aFJoh0D6KPhxQwJs7y5SM1hhiOLVlVtbk04sWvWsrGvcEie/HloOxjpo3jt34GzqFbGbC/OWvES/KHLhktvJjJrfes2OUFc1OO1ohqij4/HpYeQLxZCl8T3SqwBOjblCy6+DbjyYds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118804; c=relaxed/simple; bh=bLhC+n9ipIuspiCutxwdQslMxGZ0/Ah47Imrz5DMmkM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KwqAuKWntVlyas/oJHZoCin0OQANzqWjXLXONnLcmeYt54cweRaLSqW23qafEdwy7vhyAJvapKiQJ+2YzDt7DXWnIUmeIs8GpAjZCBBzAHtUQQYom96pWH67Uzx7zANqPhuAuKz8JTyVP3q2SnXpifr0i9x1mR1GBBmwjDuuCE8= 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=Gx4elMOX; arc=none smtp.client-ip=17.58.6.42 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="Gx4elMOX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=zUlfhPT6fg1tSrewrL0ocqPybNKCthpvg4fclsB59Y0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=Gx4elMOXbY2bzC3t6Qgh8wnYdQ3xOzIlCsRA0AiOXqFpGjUn5UQ6ESuGRAkWGvZv7 XEDlyDSbLoZu1Mq2+DqNrmD5S6NIAuPgIrVfmeEcRASJcyvCouR9pGp4nHD94jB4DE ZLcLoeMLSRLhLr7+6CtiJiuFAhGsdc/KdhFfv7PxdtcnE1dH94uNyijwR4F1LB47K1 FBqIeWdmrlwVFW1DYDYe7gG7901ybRwfvd9MVipVl3uZqNJdrTVCya1vwb4bgtNhHz d7ON/tPrwU6zN1aaV6d3w7lvSERya6xDCxDwK6vvwPjoMj50NBsROM/3AeuvfmxSDe 976q8u2ipJzqg== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id 713B24A00D7; Tue, 8 Apr 2025 13:26:35 +0000 (UTC) From: Zijun Hu Date: Tue, 08 Apr 2025 21:26:08 +0800 Subject: [PATCH 2/4] 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: <20250408-fix_configfs-v1-2-5a4c88805df7@quicinc.com> References: <20250408-fix_configfs-v1-0-5a4c88805df7@quicinc.com> In-Reply-To: <20250408-fix_configfs-v1-0-5a4c88805df7@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-GUID: BN2XzrWUhKjd3kmW2wflphInFUk-7QRW X-Proofpoint-ORIG-GUID: BN2XzrWUhKjd3kmW2wflphInFUk-7QRW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-08_05,2025-04-08_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2504080095 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 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 Signed-off-by: Zijun Hu Reviewed-by: Joel Becker --- 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 Mon Feb 9 06:31:10 2026 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (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 6600C8632E for ; Tue, 8 Apr 2025 13:26:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118810; cv=none; b=q9vNY7ubx/UbWMA/NzyjeBJg4HRxz9L3znsnJBMtC5kfBu9cj/ulx5OXuJ4XUR41JAi4SUxd3ytBoNaJulTCQaTbpIIxQQVt955SCWoMbPPlW67eFHng7ROpAvYXnY/i09LlvaiSVcQIuVwRgyzEaEvcu5aSPWQ2n2sg2ep0WKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118810; c=relaxed/simple; bh=D3TLft5vzDtLci/D0Mm+2AYzOxRwJOtxDijEOJv/d20=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QnSnXHMCSW3WLwIZVGxqf7/jpJ/3FE50a/1JHek05xKxvDunsaqNruM0tLUNwfUeZVGOK4PK1d5qsdWd37vZEvJhX9KVreE94UDr/yujUTIb+CAxIwp9vTbQMKJa46s5Ea/zmEYS7xUmWqK7C+2oQKRDYc0aYKMp1TfgjK1i5XA= 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=A7+8kzQI; arc=none smtp.client-ip=17.58.6.42 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="A7+8kzQI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=WiNh5TKh3hAOkb38yFzUqVNfpE8DqEf28HYHG1c8eo0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=A7+8kzQIF3s4pmHH0XWDacSy5eeEAxAjJxMxhkb26ueniBt+RWOLltbI5HPLk2MUA rO3NngrdDecPfxBdXwMuU15biWLJVmCjDMqORPB9od5f0GwgQpU5YZpE+/QTx1vBD8 wZ9LF/oMxqFmP8UUj340lbnnaoFvhobGvlG4kLx4Ra+0duHk/roRtZ1TKxImbQdOO+ mLAOwHxVO33Sk6ly7MY6ME3VHAWyabj+0+I4D/QQpCdOCqnsxtzwyvoVjgy5wYpen4 CQEfNiNLiew+SO9Ik1N0K5V+/LWVFNjjN2RdEKYjl65VWQz7a8AE2rodBZK2ri9c/Y n8zc5DKs+RyXg== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id 844F64A010E; Tue, 8 Apr 2025 13:26:42 +0000 (UTC) From: Zijun Hu Date: Tue, 08 Apr 2025 21:26:09 +0800 Subject: [PATCH 3/4] 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: <20250408-fix_configfs-v1-3-5a4c88805df7@quicinc.com> References: <20250408-fix_configfs-v1-0-5a4c88805df7@quicinc.com> In-Reply-To: <20250408-fix_configfs-v1-0-5a4c88805df7@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-GUID: rDoWmsIkZXYLyvFoz1oiR2Yxxm_ruSsn X-Proofpoint-ORIG-GUID: rDoWmsIkZXYLyvFoz1oiR2Yxxm_ruSsn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-08_05,2025-04-08_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2504080095 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 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. Signed-off-by: Zijun Hu Reviewed-by: Joel Becker --- 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 From nobody Mon Feb 9 06:31:10 2026 Received: from pv50p00im-zteg10011501.me.com (pv50p00im-zteg10011501.me.com [17.58.6.42]) (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 6CC2E8632E for ; Tue, 8 Apr 2025 13:26:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=17.58.6.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118817; cv=none; b=EEuQnpO/rZ38vCtwVy8a7zeq2pNqRvHgw7v/6CjmIfI5hA9yn+/vgU594O7RzUo6mqXTjljlwQnfN0QinFEGeN3xOhkem6XtWYOYfxEAz057pQiVOnoN6IFnORzafuWH8qaCrHzEk0cF2Sxg1tXeNps9ShaqcOqyvb90btMs3GA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744118817; c=relaxed/simple; bh=mtSZiNQOogGx0MHYX1eT2nG24+zA53rj37aOcTwxrFM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=A2Sx2qR/tuhKFU8x8idlBui3jhI7vlVx9SqykzOIQGU/ogdf34FTXz5OQY7q/IDAQx5+k/Ur2h+gvsWZjL1lCOMrTGnD5z5Lasz5QCWmh0ttxUcL2YbEu3i1dxBDAqy2ipXAxBdNMojI71NRgYqBtQfOuQ9pRlehX/8I0vsb5Wc= 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=tMlh6pgt; arc=none smtp.client-ip=17.58.6.42 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="tMlh6pgt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=ToX3+7Y3Y2WjC89z+4I5sSRGLFPhZkkySKnQkQN6CUQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=tMlh6pgtP+e4aHPaY48QsfzwTc0DFy+y6ALPBZCmdtAuheIUOC61vlAnmb4IQZree G9SEJHx4mfmKa8jnthhCI15BIl68U+k2/9nZiPqs3MeZDD9P0MpyuRpIGSghJ4tLwA qWEcCiJcYndUwFepuZ/Kapj2u8yovAGmC7wQa2mtoOmSAFcPwRXYZapky+1a+UWBoK 39DZdhS33NXhsJJaohUEjidj5EwyDtZTIH28O8Ab8Y7gtQo/76G2cJ2FTXbktHrYxd 9q3/Ldq30o1hVdtH17Z1p2j5CXhL1ljo/vZBF8lm4dQ6PUAW8YW1dlyEoDfyqA1xSv Rt8jJISoUBiJA== Received: from [192.168.1.26] (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011501.me.com (Postfix) with ESMTPSA id 19F3F4A03F7; Tue, 8 Apr 2025 13:26:49 +0000 (UTC) From: Zijun Hu Date: Tue, 08 Apr 2025 21:26:10 +0800 Subject: [PATCH 4/4] configfs: Correct condition for returning -EEXIST in configfs_symlink() 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: <20250408-fix_configfs-v1-4-5a4c88805df7@quicinc.com> References: <20250408-fix_configfs-v1-0-5a4c88805df7@quicinc.com> In-Reply-To: <20250408-fix_configfs-v1-0-5a4c88805df7@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-GUID: NxXVWSIJKHafJxtQFxXPa_5-hUFwf5zZ X-Proofpoint-ORIG-GUID: NxXVWSIJKHafJxtQFxXPa_5-hUFwf5zZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-08_05,2025-04-08_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=739 spamscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2504080095 X-Apple-Remote-Links: v=1;h=KCk=;charset=UTF-8 From: Zijun Hu configfs_symlink() returns -EEXIST under condition d_unhashed(), but the condition often means the dentry does not exist. Fix by changing the condition to !d_unhashed(). Fixes: 351e5d869e5a ("configfs: fix a deadlock in configfs_symlink()") Cc: stable@vger.kernel.org Signed-off-by: Zijun Hu --- fs/configfs/symlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index 69133ec1fac2a854241c2a08a3b48c4c2e8d5c24..cccf61fb8317d739643834e1810= b7f136058f56c 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c @@ -193,7 +193,7 @@ int configfs_symlink(struct mnt_idmap *idmap, struct in= ode *dir, if (ret) goto out_put; =20 - if (dentry->d_inode || d_unhashed(dentry)) + if (dentry->d_inode || !d_unhashed(dentry)) ret =3D -EEXIST; else ret =3D inode_permission(&nop_mnt_idmap, dir, --=20 2.34.1