Project

General

Profile

Bug #9616

Bogus error when attempting to set property on read-only pool

Added by Andrew Stormont over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2018-06-17
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

When attempting to set a property on a read-only pool the zfs command exits with "internal error: out of memory". This happens because in the case of a read-only pool the error list is not filled, which causes the call to nvlist_unpack() in zcmd_read_dst_nvlist() to fail with "ENOTSUP". The code wrongly assumes that the only way nvlist_unpack() can fail is with ENOMEM and calls no_memory() which prints the bogus error and exits.

History

#2

Updated by Prakash Surya about 1 year ago

Before patch:

# zfs set mountpoint=/test testpool
internal error: out of memory

After patch:

# zfs set mountpoint=/test testpool
cannot set property for 'testpool': pool is read-only

#3

Updated by Electric Monk about 1 year ago

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

git commit f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391

commit  f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391
Author: Andrew Stormont <astormont@racktopsystems.com>
Date:   2018-09-18T20:48:05.000Z

    9616 Bogus error when attempting to set property on read-only pool
    Reviewed by: Paul Dagnelie <pcd@delphix.com>
    Reviewed by: Matt Ahrens <matt@delphix.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF