Project

General

Profile

Bug #4121

vdev_label_init should treat request as succeeded when pool is read only

Added by Xin Li almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2013-09-09
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage

Description

We have run into an assertion on FreeBSD while trying to import a pool read-only:

zio->io_type != ZIO_TYPE_WRITE || spa_writeable(spa)

Looking more closely, it seems that the write was initiated by vdev_label_init, which is in turn called from spa_import via spa_validate_aux. When importing a pool read-only, it does not really make sense to actually do full initialization of a label, which would in turn initiate a write that violates the aforementioned assertion.

This version of patch was originally suggested by George Wilson. Our initial version covers only spa_import() and skips calls to spa_validate_aux() if pool is not imported with write enabled.

We would like to have the patch applied against Illumos since the same problem would exist there too.


Files

vdev_label.diff (491 Bytes) vdev_label.diff Xin Li, 2013-09-09 04:44 AM

Related issues

Has duplicate illumos gate - Bug #4364: Assertion (type != ZIO_TYPE_WRITE || spa_writeable(spa)) triggered trying to import pool with cache vdevs in readonly modeRejected2013-11-27

Actions

History

#1

Updated by Christopher Siden over 5 years ago

  • Status changed from New to Closed
commit 973c78e94bf9634782164382c9e291bf81161fa5
Author: George Wilson <george.wilson@delphix.com>
Date:   Wed Dec 11 11:45:30 2013

    4121 vdev_label_init should treat request as succeeded when pool is read only
    Reviewed by: Christopher Siden <christopher.siden@delphix.com>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF