From: Joel Becker <jlbec@evilplan.org>
To: Zijun Hu <zijun_hu@icloud.com>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-kernel@vger.kernel.org, Zijun Hu <quic_zijuhu@quicinc.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/4] configfs: Do not override creating attribute file failure in populate_attrs()
Date: Tue, 8 Apr 2025 15:14:16 -0700 [thread overview]
Message-ID: <Z_WfuMDl2IIxYEOd@google.com> (raw)
In-Reply-To: <20250408-fix_configfs-v1-2-5a4c88805df7@quicinc.com>
On Tue, Apr 08, 2025 at 09:26:08PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
>
> 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 <quic_zijuhu@quicinc.com>
Reviewed-by: Joel Becker <jlbec@evilplan.org>
> ---
> 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..64272d3946cc40757dca063190829958517eceb3 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 = 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;
>
> --
> 2.34.1
>
--
Life's Little Instruction Book #511
"Call your mother."
http://www.jlbec.org/
jlbec@evilplan.org
next prev parent reply other threads:[~2025-04-08 22:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 13:26 [PATCH 0/4] configfs: fix bugs Zijun Hu
2025-04-08 13:26 ` [PATCH 1/4] configfs: Delete semicolon from macro type_print() definition Zijun Hu
2025-04-08 22:12 ` Joel Becker
2025-04-17 14:38 ` Breno Leitao
2025-04-17 14:47 ` Zijun Hu
2025-04-08 13:26 ` [PATCH 2/4] configfs: Do not override creating attribute file failure in populate_attrs() Zijun Hu
2025-04-08 22:14 ` Joel Becker [this message]
2025-04-08 13:26 ` [PATCH 3/4] configfs: Correct error value returned by API config_item_set_name() Zijun Hu
2025-04-08 22:26 ` Joel Becker
2025-04-08 13:26 ` [PATCH 4/4] configfs: Correct condition for returning -EEXIST in configfs_symlink() Zijun Hu
2025-04-08 22:49 ` Joel Becker
2025-04-10 1:17 ` Zijun Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z_WfuMDl2IIxYEOd@google.com \
--to=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pantelis.antoniou@konsulko.com \
--cc=quic_zijuhu@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zijun_hu@icloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox