Go to file
Brian Behlendorf f74fae8b30 Fix 4K sector support
Yesterday I ran across a 3TB drive which exposed 4K sectors to
Linux.  While I thought I had gotten this support correct it
turns out there were 2 subtle bugs which prevented it from
working.

  sudo ./cmd/zpool/zpool create -f large-sector /dev/sda
  cannot create 'large-sector': one or more devices is currently unavailable

1) The first issue was that it was possible that bdev_capacity()
would return the number of 512 byte sectors rather than the number
of 4096 sectors.  Internally, certain Linux functions only operate
with 512 byte sectors so you need to be careful.  To avoid any
confusion in the future I've updated bdev_capacity() to simply
return the device (or partition) capacity in bytes.  The higher
levels of ZFS want the value in bytes anyway so this is cleaner.

2) When creating a bio the ->bi_sector count must always be
expressed in 512 byte sectors.  The existing code would scale
the byte offset by the logical sector size.   Until now this was
always 512 so it never caused problems.  Trying a 4K sector drive
clearly exposed the issue.  The problem has been fixed by
hard coding the 512 byte sector which is exactly what the bio
code does internally.

With these changes I'm now able to create ZFS pools using 4K
sector drives.  No issues were observed during fairly extensive
testing.  This is also a low risk change if your using 512b
sectors devices because none of the logic changes.

Closes #256
2011-05-27 11:38:53 -07:00
cmd Default to internal 'zfs userspace' implementation 2011-05-20 10:25:41 -07:00
config Fix distribution detection for gentoo 2011-05-14 08:54:48 -07:00
dracut Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
etc Remove root 'ls' after mount workaround 2011-05-12 15:01:35 -07:00
include Disable direct reclaim for z_wr_* threads 2011-05-06 15:26:26 -07:00
lib Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
man Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
module Fix 4K sector support 2011-05-27 11:38:53 -07:00
patches Add build system 2010-08-31 13:41:27 -07:00
scripts Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
.gitignore Ignore unsigned module build products 2010-03-09 14:14:09 -08:00
AUTHORS Add Gunnar Beutner to AUTHORS for his contributions 2011-04-19 14:14:51 -07:00
autogen.sh Minor packaging fixes 2010-09-01 15:42:32 -07:00
ChangeLog Add build system 2010-08-31 13:41:27 -07:00
configure Fix distribution detection for gentoo 2011-05-14 08:54:48 -07:00
configure.ac Set cmd paths in udev rules using --prefix 2011-03-25 10:05:09 -07:00
COPYING Relocate COPYING+COPYRIGHT, remove README cruft 2008-12-01 15:34:53 -08:00
COPYRIGHT Update COPYRIGHT to reference zpios CDDL exceptions. 2010-05-18 14:25:28 -07:00
DISCLAIMER Update COPYRIGHT and DISCLAIMER. 2010-05-18 10:32:23 -07:00
Makefile.am Add dracut support 2011-03-17 16:52:04 -07:00
Makefile.in Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
META Prep zfs-0.6.0-rc4 tag 2011-05-03 10:29:05 -07:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README.markdown Fix markdown rendering 2010-09-15 09:09:37 -07:00
zfs_config.h.in Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00
zfs-modules.spec.in Fix rebuildable RPMs for el6/ch5 2011-04-08 10:22:42 -07:00
zfs-script-config.sh.in Unconditionally load core kernel modules 2010-11-11 11:38:25 -08:00
ZFS.RELEASE Update to onnv_147 2010-08-26 14:24:34 -07:00
zfs.spec.in Add parted and lsscsi dependencies to zfs-test 2011-04-19 15:22:46 -07:00

Native ZFS for Linux! ZFS is an advanced file system and volume manager which was originally developed for Solaris. It has been successfully ported to FreeBSD and now there is a functional Linux ZFS kernel port too. The port currently includes a fully functional and stable SPA, DMU, and ZVOL with a ZFS Posix Layer (ZPL) on the way!

$ ./configure
$ make pkg

Full documentation for building, configuring, and using ZFS can be found at: http://zfsonlinux.org