36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
From ab287d709809b6dfe4d3c42016a543d976533d51 Mon Sep 17 00:00:00 2001
|
|
From: Zijun Hu <quic_zijuhu@quicinc.com>
|
|
Date: Wed, 7 May 2025 19:50:26 +0800
|
|
Subject: 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 | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
--- a/fs/configfs/dir.c
|
|
+++ b/fs/configfs/dir.c
|
|
@@ -619,7 +619,7 @@ static int populate_attrs(struct config_
|
|
break;
|
|
}
|
|
}
|
|
- if (t->ct_bin_attrs) {
|
|
+ if (!error && t->ct_bin_attrs) {
|
|
for (i = 0; (bin_attr = t->ct_bin_attrs[i]) != NULL; i++) {
|
|
if (ops && ops->is_bin_visible && !ops->is_bin_visible(item, bin_attr, i))
|
|
continue;
|