]> git.proxmox.com Git - mirror_zfs.git/commit - lib/libzfs/libzfs_pool.c
OpenZFS 6865 - want zfs-tests cases for zpool labelclear command
authorYuri Pankov <yuri.pankov@nexenta.com>
Fri, 13 Jan 2017 17:25:15 +0000 (09:25 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 11 Apr 2017 16:54:39 +0000 (09:54 -0700)
commitdbb38f660509073f43284c6c745a4449ffd46385
treea980a446a446b1e1d1291010653719f5b21fbf9c
parent047187c1bd4a893e7a89e8795fa8f4ecc3eb0732
OpenZFS 6865 - want zfs-tests cases for zpool labelclear command

Authored by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Porting Notes:
- Updated 'zpool labelclear' and 'zdb -l' such that they attempt
  to find a vdev given solely its short name.  This behavior is
  consistent with the upstream OpenZFS code and the test cases
  depend on it.  The actual implementation differs slightly due
  to device naming conventions on Linux.
- auto_online_001_pos, auto_replace_001_pos and add-o_ashift
  test cases updated to expect failure when no label exists.
- read_efi_label() and zpool_label_disk_check() are read-only
  operations and should use O_RDONLY at open time to enforce this.
- zpool_label_disk() and zpool_relabel_disk() write the partition
  information using O_DIRECT an fsync() and page cache invalidation
  to ensure a consistent view of the device.
- dump_label() in zdb should invalidate the page cache in order
  to get the authoritative label from disk.

OpenZFS-issue: https://www.illumos.org/issues/6865
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c95076c
Closes #5981
15 files changed:
cmd/zdb/zdb.c
cmd/zpool/zpool_main.c
cmd/zpool/zpool_vdev.c
configure.ac
include/libzfs.h
lib/libzfs/libzfs_pool.c
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/cli_root/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_labelclear/Makefile.am [new file with mode: 0644]
tests/zfs-tests/tests/functional/cli_root/zpool_labelclear/labelclear.cfg [new file with mode: 0644]
tests/zfs-tests/tests/functional/cli_root/zpool_labelclear/zpool_labelclear_active.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_labelclear/zpool_labelclear_exported.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/fault/auto_online_001_pos.ksh
tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh