zfs/lib/libspl/include
Brian Behlendorf df554c148e Fix 'zfs set volsize=N pool/dataset'
This change fixes a kernel panic which would occur when resizing
a dataset which was not open.  The objset_t stored in the
zvol_state_t will be set to NULL when the block device is closed.
To avoid this issue we pass the correct objset_t as the third arg.

The code has also been updated to correctly notify the kernel
when the block device capacity changes.  For 2.6.28 and newer
kernels the capacity change will be immediately detected.  For
earlier kernels the capacity change will be detected when the
device is next opened.  This is a known limitation of older
kernels.

Online ext3 resize test case passes on 2.6.28+ kernels:
$ dd if=/dev/zero of=/tmp/zvol bs=1M count=1 seek=1023
$ zpool create tank /tmp/zvol
$ zfs create -V 500M tank/zd0
$ mkfs.ext3 /dev/zd0
$ mkdir /mnt/zd0
$ mount /dev/zd0 /mnt/zd0
$ df -h /mnt/zd0
$ zfs set volsize=800M tank/zd0
$ resize2fs /dev/zd0
$ df -h /mnt/zd0

Original-patch-by: Fajar A. Nugraha <github@fajar.net>
Closes #68
Closes #84
2011-05-02 08:54:40 -07:00
..
ia32 Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
rpc Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
sys Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
util Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
Makefile.am Support custom build directories and move includes 2010-09-08 12:38:56 -07:00
Makefile.in Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
assert.h Add linux libspl support 2010-08-31 13:41:59 -07:00
atomic.h Add linux libspl support 2010-08-31 13:41:59 -07:00
attr.h Add linux libspl support 2010-08-31 13:41:59 -07:00
devid.h Add linux libspl support 2010-08-31 13:41:59 -07:00
libdevinfo.h Add linux libspl support 2010-08-31 13:41:59 -07:00
libgen.h Add missing mkdirp prototype 2010-12-14 10:06:44 -08:00
libshare.h Minimal libshare infrastructure 2011-02-04 16:14:29 -08:00
limits.h Add linux libspl support 2010-08-31 13:41:59 -07:00
locale.h Add linux libspl support 2010-08-31 13:41:59 -07:00
note.h Add linux libspl support 2010-08-31 13:41:59 -07:00
priv.h Add linux libspl support 2010-08-31 13:41:59 -07:00
statcommon.h Add linux libspl support 2010-08-31 13:41:59 -07:00
stdio.h Add linux libspl support 2010-08-31 13:41:59 -07:00
stdlib.h Add linux libspl support 2010-08-31 13:41:59 -07:00
string.h Add linux libspl support 2010-08-31 13:41:59 -07:00
strings.h Add linux libspl support 2010-08-31 13:41:59 -07:00
stropts.h Add linux libspl support 2010-08-31 13:41:59 -07:00
synch.h Add linux libspl support 2010-08-31 13:41:59 -07:00
thread.h Add linux libspl support 2010-08-31 13:41:59 -07:00
tzfile.h Add linux libspl support 2010-08-31 13:41:59 -07:00
ucred.h Add linux libspl support 2010-08-31 13:41:59 -07:00
umem.h Add linux libspl support 2010-08-31 13:41:59 -07:00
unistd.h Use gethostid in the Linux convention. 2011-04-25 10:36:17 -05:00
zone.h Add linux libspl support 2010-08-31 13:41:59 -07:00