configfs: Do not override creating attribute file failure in populate_attrs()
authorZijun Hu <quic_zijuhu@quicinc.com>
Wed, 7 May 2025 11:50:26 +0000 (19:50 +0800)
committerAndreas Hindborg <a.hindborg@kernel.org>
Fri, 9 May 2025 08:11:13 +0000 (10:11 +0200)
commitf830edbae247b89228c3e09294151b21e0dc849c
treecfa94ff53d615c04b33a82dea58d011cff26b7ec
parentd78aa60cfa7ece7477a4089a3a4b520ec7beba1b
configfs: Do not override creating attribute file failure in populate_attrs()

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 <jlbec@evilplan.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20250507-fix_configfs-v3-2-fe2d96de8dc4@quicinc.com
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
fs/configfs/dir.c