]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:25 +0000 (11:07 +0100)
commit3526d279e5f780a9bfa343bf9b40a7ace2876320
tree041c9467e096be7f824c183632428bd4236d8b76
parentdf3670a8be5174b0243e1879ad8f114b6a3df9e3
configfs: Do not override creating attribute file failure in populate_attrs()

commit f830edbae247b89228c3e09294151b21e0dc849c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/configfs/dir.c