HomeFreeBSD

MFV r323790: 8567 Inconsistent return value in zpool_read_label

Description

MFV r323790: 8567 Inconsistent return value in zpool_read_label

illumos/illumos-gate@c861bfbd77c4ae780a0341e9cb6926d8b74341cf
https://github.com/illumos/illumos-gate/commit/c861bfbd77c4ae780a0341e9cb6926d8b74341cf

https://www.illumos.org/issues/8567

If fstat64 fails, pread64 fails, or the label is unintelligible,
zpool_read_label will return 0. But if malloc fails, it will return -1. For
consistency, it should always return -1 on failure or 0 on success.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alan Somers <asomers@gmail.com>

MFC after: 2 weeks

Details

Provenance
avgAuthored on
Reviewer
matthew
Parents
rS323790: 8567 Inconsistent return value in zpool_read_label
Branches
Unknown
Tags
Unknown