HomeFreeBSD

Fix "out of memory" error

Description

Fix "out of memory" error

Drop the no_memory() call from zpool_in_use() when reading the
label fails and instead return the error to the caller. This
prevents a misleading "internal error: out of memory" error
when the label can't be read. This will result in is_spare()
returning B_FALSE instead of aborting, which is already safely
handled.

Furthermore, on Linux it's possible for EREMOTEIO to returned
by an NVMe device if the device has been low-level formatted
and not rescanned. In this case we want to fallback to the
legacy scanning method and read any of the labels we can.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #13538
Closes #15747

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jan 12 2024, 8:35 PM
GitHub <noreply@github.com>Committed on Jan 12 2024, 8:35 PM
Parents
rG363368c67045: fix: preserve linux kmod signature in zfs-kmod rpm spec
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGa1771d243a57: Fix "out of memory" error (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jan 12 2024, 8:35 PM