]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix "out of memory" error
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 12 Jan 2024 20:35:29 +0000 (12:35 -0800)
committerGitHub <noreply@github.com>
Fri, 12 Jan 2024 20:35:29 +0000 (12:35 -0800)
commita1771d243a57524c6599d7beedcb2085e5c05395
treed3b5f1d2aac2171314f5245d71f3b49c3d5d8a00
parent363368c67045657b012a2756f54b4c04de01e4ef
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
lib/libzfs/libzfs_import.c
lib/libzutil/zutil_import.c