Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Mar 2019 08:32:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 236710] zfs: clone + resize = dataset is busy
Message-ID:  <bug-236710-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236710

            Bug ID: 236710
           Summary: zfs: clone + resize =3D dataset is busy
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: olevole@olevole.ru

( copy of the problem published in freebsd-fs@ )

I see the following problem on FreeBSD 13.0-CURRENT
r345087M amd64, zpool version 28, zfs version 5

If you create a ZVOL, fill in specific data, take a snapshot, clone
and resize, you will get a blocked pool (device busy for : export -f,
destroy -f ..)---

what i found:

a) the problem only appears on clone/snapshot, there is no problem on
a simple zvol resize;

b) the nature of the data affects the problem:

  - when zvol no data, problem is missing
  - If you try to fill zvol with random data, for example: dd
if=3D/dev/random of=3D<zvol> there are also no problems. But problem exist
if I try to fill in with cloud images data (
http://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/12.0-RELEASE/amd64/La=
test/
, http://cloud-images.ubuntu.com/xenial/current/
) - in fact, these are raw images of the installed OS.

c) The problem only occurs when creating zvol + resizing (in two
commands). If you try to do atomically and simultaneously:

 /sbin/zfs clone -o volsize=3D<new_size> ...

there is no problem, but with this:

/sbin/zfs clone ..
/sbin/zfs set volsize=3D

problem exist.

Maybe this is not a ZFS problem and GEOM-related ?

Step-by-step how to reproduce (where z01 - active ZFS pool):
---
% wget
http://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/12.0-RELEASE/amd64/La=
test/FreeBSD-12.0-RELEASE-amd64.raw.xz

% xz -d FreeBSD-12.0-RELEASE-amd64.raw.xz

> ( /usr/bin/stat -f "%z" FreeBSD-12.0-RELEASE-amd64.raw  -- get size)
>  33286062080

% /sbin/zfs create -sV 33286062080 -o volmode=3Ddev z01/test1

% dd bs=3D1m if=3DFreeBSD-12.0-RELEASE-amd64.raw of=3D/dev/zvol/z01/test1
>  31744+1 records in
>  31744+1 records out
>  33286062080 bytes transferred in 127.530635 secs (261004441 bytes/sec)

% /sbin/zfs snapshot z01/test1 at snap

% /sbin/zfs clone z01/test1 at snap

> ( resizing. For example, double up  )
>  bc -e '33286062080 * 2'
>  66572124160

% /sbin/zfs set volsize=3D66572124160 z01/test2

% /sbin/zfs destroy z01/test2
> cannot destroy 'z01/test2': dataset is busy

% zpool export -f z01
> cannot export 'z01': pool is busy
---

with truss i can see:

..
ioctl(3,0xc0185a15 { IORW 0x5a('Z'), 21, 24 },0x7fffffffcd78) ERR#3
'No such process'
ioctl(3,0xc0185a15 { IORW 0x5a('Z'), 21, 24 },0x7fffffffcd78) ERR#3
'No such process'
ioctl(6,0xc0185a18 { IORW 0x5a('Z'), 24, 24 },0x7fffffffcdb8) ERR#16
'Device busy'

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236710-227>