Skip to content

Commit f830edb

Browse files
zijun-huAndreas Hindborg
authored andcommitted
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: 03607ac ("configfs: implement binary attributes") Cc: [email protected] Reviewed-by: Joel Becker <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andreas Hindborg <[email protected]>
1 parent d78aa60 commit f830edb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/configfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ static int populate_attrs(struct config_item *item)
619619
break;
620620
}
621621
}
622-
if (t->ct_bin_attrs) {
622+
if (!error && t->ct_bin_attrs) {
623623
for (i = 0; (bin_attr = t->ct_bin_attrs[i]) != NULL; i++) {
624624
if (ops && ops->is_bin_visible && !ops->is_bin_visible(item, bin_attr, i))
625625
continue;

0 commit comments

Comments
 (0)