Project

General

Profile

Bug #3892

zfs user/group accounting does not work on upgraded pools

Added by Matthew Ahrens over 7 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2013-07-16
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Pools upgraded from version 14 or earlier should be able to use user/group accounting (e.g. "zfs userspace"), however now it doesn't work. This bug was introduced by:

commit 1af68beac368dae20a9c5d738cf6b6320cf9d63a
Author: Alexander Stetsenko <>
Date: Wed Dec 1 02:30:25 2010 +0300

278 get rid zfs of python and pyzfs dependencies
Reviewed by:
Reviewed by:
Reviewed by:
Reviewed by:
Approved by:

The bug can be reproduced by upgrading an old version pool (version 14 or earlier), as follows:

  1. zpool create -o version=14 old c1t1d0
  2. zfs create old/fs
  3. zfs userspace old/fs
    cannot get used/quota for old/fs: unsupported version or feature
    ----> this is correct; the pool doesn't support it
  4. zpool upgrade old
    This system supports ZFS pool feature flags.

Successfully upgraded 'old' from version 14 to feature flags.
Enabled the following features on 'old':
async_destroy
empty_bpobj
lz4_compress
spacemap_histogram

  1. zfs userspace old/fs
    cannot get used/quota for old/fs: unsupported version or feature
    ------> now the pool supports it; should have gathered accounting info
  1. /usr/bin/i386/python2.6 /usr/lib/zfs/pyzfs.py userspace old/fs
    Initializing accounting information on old filesystem, please wait...
    TYPE NAME USED QUOTA
    POSIX User root 3K none
    ------> that's what should have happened.

History

#1

Updated by Keith Wesolowski over 7 years ago

zfs upgrade old/fs will solve this. Is this even a bug in zfs(1M), or is it a bug in the python thing that it's auto-upgrading a filesystem (!)?

#2

Updated by Matthew Ahrens over 7 years ago

True, "zfs upgrade" is a workaround. An even better workaround would be to unmount & remount the dataset, which is the critical part of the "zfs upgrade". Note that the filesystem need not be upgraded to get the accounting information (only to set user/group quotas).

The python behavior is not a bug. I would describe the it as "auto gathering the data you asked for". The filesystem is not upgraded, in that its on-disk format does not change; it can still be sent freely to older systems / pools.

updated: unmount&remount is necessary but not sufficient. This bug could be rephrased as, "on upgraded pools, zfs filesystems must be upgraded to get user accounting information". This is a regression from the previous behavior, which allowed us to get the user/group accounting information (via "zfs userspace") without upgrading the filesystem.

Also available in: Atom PDF