mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Yichong Chen <chenyichong@uniontech.com>
Cc: a.hindborg@kernel.org, pantelis.antoniou@konsulko.com,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] configfs: avoid committing failed binary attribute writes
Date: Fri, 21 Aug 2026 02:07:37 -0700	[thread overview]
Message-ID: <aogVQHA7Y-FV7O9y@gmail.com> (raw)
In-Reply-To: <20260821073341.2006955-1-chenyichong@uniontech.com>

On Fri, Aug 21, 2026 at 03:33:41PM +0800, Yichong Chen wrote:
> Configfs binary attributes buffer write data and submit the final buffer
> on release.  The write path sets write_in_progress before it knows
> whether the current write can be accepted.
> 
> If the first write fails before any data is copied, for example because
> the write exceeds cb_max_size or the buffer allocation fails, release still
> treats the file as having a pending binary write and calls the attribute
> write callback with the current buffer state.  For ACPI configfs, an
> oversized first write to the aml attribute can therefore fail with -EFBIG
> and then oops on close when acpi_table_aml_write() is called with a NULL
> buffer.
> 
> Only mark the binary attribute as having a write in progress after data
> has actually been copied into the buffer.
> 
> Fixes: 03607ace807b ("configfs: implement binary attributes")
> Signed-off-by: Yichong Chen <chenyichong@uniontech.com>

Reviewed-by: Breno Leitao <leitao@debian.org>

      reply	other threads:[~2026-08-21  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21  7:33 Yichong Chen
2026-08-21  9:07 ` Breno Leitao [this message]

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=aogVQHA7Y-FV7O9y@gmail.com \
    --to=leitao@debian.org \
    --cc=a.hindborg@kernel.org \
    --cc=chenyichong@uniontech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pantelis.antoniou@konsulko.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

all inboxes | Powered by JetHome®