[Pkg-zfsonlinux-devel] disable-bpool-upgrade.patch

Colm Buckley colm at tuatha.org
Tue Aug 18 17:57:06 BST 2020


Ok, a first stab at this is at
https://salsa.debian.org/zfsonlinux-team/zfs/-/merge_requests/25

Note: I'm using a zpool property ("inhibitupgrade") instead of a dataset
user property, because getting to dataset properties (especially user
properties) from the zpool data structure seems to be remarkably tedious.
If there's a straightforward idiomatic way to do so, that might still be a
better approach. But given that this property changes the behavior of the
zpool command, perhaps pool properties are the right place for this flag.

This quick test.sh script attached seems to do the right thing - see
text.txt output.

Thoughts and comments welcome,

Colm





On Tue, 18 Aug 2020 at 08:38, Richard Laager <rlaager at wiktel.com> wrote:

> On 8/14/20 10:09 AM, Colm Buckley wrote:
> > I see what Ubuntu were trying to achieve with
> > 4100-disable-bpool-upgrade.patch, but I really don't like the hardcoding
> > of the "bpool" name into the tools like this.
> >
> > Would it be reasonable to adopt this patch (changing the behavior of
> > `zpool status` and `zpool upgrade`) if instead of checking for
> > name='bpool', it checked for a property; eg: if
> > org.debian:grub-workaround = true
> Yes, a property would be better. We can bikeshed the name and value. ;)
>
> I'd rather avoid words like "workaround".
>
> Conventionally, ZFS properties tend to be on/off rather than true/false.
>
> Maybe org.debian:grub-features=on?
>
> The long-term upstream plan was to have a "features mask" function, such
> that you could do something like `zpool set features=grub bpool`, which
> would mask the features (for `zpool upgrade` and the warning in `zpool
> status`) to the subset supported by grub. Nobody is currently working on
> that.
>
> Maybe org.debian:features=grub?
>
> --
> Richard
>


-- 
Colm Buckley | colm at tuatha.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-zfsonlinux-devel/attachments/20200818/13ab6a40/attachment.html>
-------------- next part --------------
Creating zvol rpool/test-3339 ...
Creating zpool tpool-3339 on /dev/zvol/rpool/test-3339 with features disabled ...

zpool status tpool-3339 :
  pool: tpool-3339
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
	still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
	the pool may no longer be accessible by software that does not support
	the features. See zpool-features(5) for details.
  scan: none requested
config:

	NAME         STATE     READ WRITE CKSUM
	tpool-3339   ONLINE       0     0     0
	  test-3339  ONLINE       0     0     0

errors: No known data errors

Setting inhibitupgrade property ...

zpool status tpool-3339 :
  pool: tpool-3339
 state: ONLINE
  scan: none requested
config:

	NAME         STATE     READ WRITE CKSUM
	tpool-3339   ONLINE       0     0     0
	  test-3339  ONLINE       0     0     0

errors: No known data errors

zpool upgrade tpool-3339 :
'zpool upgrade' is disabled for this zpool to keep compatibility with GRUB.
Skipping upgrade.
This system supports ZFS pool feature flags.

Pool 'tpool-3339' already has all supported features enabled.

Unsetting inhibitupgrade property ...

zpool status tpool-3339 :
  pool: tpool-3339
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
	still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
	the pool may no longer be accessible by software that does not support
	the features. See zpool-features(5) for details.
  scan: none requested
config:

	NAME         STATE     READ WRITE CKSUM
	tpool-3339   ONLINE       0     0     0
	  test-3339  ONLINE       0     0     0

errors: No known data errors

zpool upgrade tpool-3339 :
This system supports ZFS pool feature flags.

Enabled the following features on 'tpool-3339':
  async_destroy
  empty_bpobj
  lz4_compress
  multi_vdev_crash_dump
  spacemap_histogram
  enabled_txg
  hole_birth
  extensible_dataset
  embedded_data
  bookmarks
  filesystem_limits
  large_blocks
  large_dnode
  sha512
  skein
  edonr
  userobj_accounting
  encryption
  project_quota
  device_removal
  obsolete_counts
  zpool_checkpoint
  spacemap_v2
  allocation_classes
  resilver_defer
  bookmark_v2

Destroying tpool-3339 and rpool/test-3339 ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.sh
Type: text/x-sh
Size: 738 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-zfsonlinux-devel/attachments/20200818/13ab6a40/attachment.sh>


More information about the Pkg-zfsonlinux-devel mailing list