Project

General

Profile

Bug #6541

Pool feature-flag check defeated if "verify" is included in the dedup property value

Added by ilove zfs over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2016-01-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

zfs_check_settable() is not quite doing its job when checking for required spa feature flags in the case of the new cryptographic checksums whenever "verify" is also specified in the requested dedup setting.

zio_checksum_to_feature() expects a zio_checksum enum not a raw property intval, so the new checksums aren't being detected when ZIO_CHECKSUM_VERIFY gets in the way.

Given a pool without feature@sha512,

zfs create -o dedup=sha512 naughty/fivetwelve_noverify_ds

fails as expected since the raw intval is indeed equal to SPA_FEATURE_SHA512.

However,

zfs create -o dedup=sha512,verify naughty/fivetwelve_verify_ds

incorrectly succeeds because ZIO_CHECKSUM_VERIFY is in the way, the raw intval is not a member of the enum, and zio_checksum_to_feature() returns SPA_FEATURE_NONE, with the result
that spa_feature_is_enabled() is never called.

This was first detected with edonr, since in that case verify is required.


Files

planned-demise.png (43.8 KB) planned-demise.png ilove zfs, 2016-01-12 10:11 AM

History

#1

Updated by ilove zfs over 3 years ago

Additional investigation shows that this does indeed cause panic (screenshot attached) on OmniOS (Bloody release, r151017, omnios-2e8c0ba, OmniOS_Text_bloody_20151211.iso), as soon as you actually start to add some data to the dataset.

zpool create -d planned c2t1d0
zfs create -o dedup=edonr,verify planned/demise
echo good > /panned/demise/bye.txt
... panic

Stack:

panic: assertition failed: feature_get_refcount(spa, feature, &refcount) != 48 (0x30 != 0x30), file: ../../common/fs/zfs/zfeature.c, line: 390
zfs:feature_do_action
zfs:spa_feature_incr
zfs:dsl_dataset_activate_feature
zfs:dsl_dataset_sync
zfs:dsl_pool_sync
zfs:spa_sync
zfs:txg_sync_thread
unix:thread_start
#2

Updated by Electric Monk over 3 years ago

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

git commit 971640e6aa954c91b0706543741aa4570299f4d7

commit  971640e6aa954c91b0706543741aa4570299f4d7
Author: ilovezfs <ilovezfs@icloud.com>
Date:   2016-02-11T18:22:04.000Z

    6541 Pool feature-flag check defeated if "verify" is included in the dedup property value
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Richard Laager <rlaager@wiktel.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF