Project

General

Profile

Bug #6874

rollback and receive need to reset ZPL state to what's on disk

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

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

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

When we do a clone swap (caused by "zfs rollback" or "zfs receive"), the ZPL doesn't completely reload the state from the DMU; some values remain cached in the zfsvfs_t.

steps to reproduce:

```
#!/bin/bash -x

zfs destroy -R test/fs
zfs destroy -R test/recvd

zfs create test/fs
zfs snapshot test/fs@a
zfs set userquota@$USER=1m test/fs
zfs snapshot test/fs@b

zfs send test/fs@a | zfs recv test/recvd
zfs send -i @a test/fs@b | zfs recv test/recvd
zfs userspace test/recvd
  1. should show 1m quota
    dd if=/dev/urandom of=/test/recvd/file bs=1k count=1024
    sync
    dd if=/dev/urandom of=/test/recvd/file2 bs=1k count=1024
  2. should fail with ENOSPC
    sync
    zfs unmount test/recvd
    zfs mount test/recvd
    zfs userspace test/recvd
  3. if bug above, now shows 1m quota
    dd if=/dev/urandom of=/test/recvd/file3 bs=1k count=1024
  4. if bug above, now fails with ENOSPC
    ```

Related issues

Related to illumos gate - Bug #5867: zfs_resume_fs() should refresh cached z_root valueNew2015-04-24

Actions
Related to illumos gate - Bug #9324: zfs-recv can be broken by some ZFS-ioctls New2018-03-21

Actions

History

#1

Updated by Andriy Gapon over 3 years ago

  • Related to Bug #5867: zfs_resume_fs() should refresh cached z_root value added
#2

Updated by Electric Monk over 3 years ago

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

git commit 1fdcbd00c9cbac286b5f92e08877e8cb3c448420

commit  1fdcbd00c9cbac286b5f92e08877e8cb3c448420
Author: Matthew Ahrens <mahrens@delphix.com>
Date:   2016-05-11T23:30:33.000Z

    6874 rollback and receive need to reset ZPL state to what's on disk
    Reviewed by: George Wilson <george.wilson@delphix.com>
    Reviewed by: Paul Dagnelie <pcd@delphix.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

#3

Updated by Roman Strashkin over 1 year ago

  • Related to Bug #9324: zfs-recv can be broken by some ZFS-ioctls added

Also available in: Atom PDF