From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Dominik Csapak <d.csapak@proxmox.com>
Subject: [pve-devel] applied: [RFC PATCH common] sysfstools: file_write: properly catch errors
Date: Thu, 24 Oct 2024 18:32:41 +0200 [thread overview]
Message-ID: <f67d6e11-5af9-492d-80d2-7e2bdcbaf7cc@proxmox.com> (raw)
In-Reply-To: <20240723082925.934603-1-d.csapak@proxmox.com>
Am 23/07/2024 um 10:29 schrieb Dominik Csapak:
> since `print` is doing buffered IO, we don't always get an error there,
> even if the underlying write does not work.
>
> To properly catch that, do an unbuffered `syswrite` which circumvents
> all buffers and writes directly to the file handle.
>
> We aren't actually interested in the specific error here, but only if
> the write was successful or not.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>
> Note: this is heavily used when doing PCI passthrough, and it seems we
> did not catch as many errors as we thought. Maybe we should introduce an
> 'noerr' parameter and pass that on all current code paths, since i fear
> that there are many situations where the sysfs write had failed but it
> still works because we ignored it and qemu/the kernel do the right thing
> anyway.
>
I also see some regression potential, but IMO it's something that would
be very good to know, and so erroring out explicitly for now is IMO worth
it. We can then adapt this as needed on actual feedback.
> src/PVE/SysFSTools.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
applied, with Christoph's T-b thanks!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
prev parent reply other threads:[~2024-10-24 16:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 8:29 [pve-devel] " Dominik Csapak
2024-10-17 10:22 ` Christoph Heiss
2024-10-24 16:32 ` Thomas Lamprecht [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=f67d6e11-5af9-492d-80d2-7e2bdcbaf7cc@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.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