]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFV r302640: 6874 rollback and receive need to reset ZPL state to what's on disk
authorAndriy Gapon <avg@FreeBSD.org>
Thu, 14 Jul 2016 11:39:36 +0000 (11:39 +0000)
committerAndriy Gapon <avg@FreeBSD.org>
Thu, 14 Jul 2016 11:39:36 +0000 (11:39 +0000)
commit875e6e5b0462ed3f7ffcb587fbc8e4891690a00d
tree9cea4079b6ee9691970f5f5101a4258dea0fb757
parent7a946127ef539afedfdf36ee8785e79f84929836
parentfc592d9aa839312c3774967ab850de1346a8b5b6
MFV r302640: 6874 rollback and receive need to reset ZPL state to what's on disk

illumos/illumos-gate@1fdcbd00c9cbac286b5f92e08877e8cb3c448420
https://github.com/illumos/illumos-gate/commit/1fdcbd00c9cbac286b5f92e08877e8cb3c448420

https://www.illumos.org/issues/6874
  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
  ```

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Matthew Ahrens <mahrens@delphix.com>
MFC after: 3 weeks
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c