Bug #8567

Inconsistent return value in zpool_read_label

Added by Alan Somers 4 months ago. Updated 3 months ago.

Status:ClosedStart date:2017-08-07
Priority:LowDue date:
Assignee:Alan Somers% Done:

100%

Category:-
Target version:-
Difficulty:Bite-size Tags:needs-triage

Description

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.

History

#1 Updated by Electric Monk 3 months ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit c861bfbd77c4ae780a0341e9cb6926d8b74341cf

commit  c861bfbd77c4ae780a0341e9cb6926d8b74341cf
Author: Alan Somers <asomers@gmail.com>
Date:   2017-09-15T16:32:54.000Z

    8567 Inconsistent return value in zpool_read_label
    Reviewed by: Prakash Surya <prakash.surya@delphix.com>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom