Go to file
Richard Yao 8170d28126 Return correct type and offset from zfs_readdir
zfs_readdir() is used by getdents(), which provides a list of all files
in directory, their types and an offset that be used by llseek() to seek
to the next directory entry.

On Solaris, the first two directory entries "." and ".." respectively
have offsets 1 and 2 on ZFS while the other files have rather large
numbers. Currently, ZFSOnLinux is  giving "." offset 0 and all other
entries large numbers. The first entry's next entry offset points to
itself, which causes software that uses llseek() in conjunction with
getdents() for filesystem navigation to enter an infinite loop.  The
offsets used for each directory entry are filesystem specific on all
platforms, so we can fix this by adopting the Solaris behavior.

Also, we currently report each directory entry as having type 0 (???).
This is not wrong, but we can do better. getdents() on Solaris does not
appear to provide this information, but it does on Linux and Mac OS X
do. ZFS provides easy access to type information in zfs_readdir(), so
this patch provides this as well.

Reported-by: Andrey <andrey@kudinov.su>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1624
2013-08-07 16:16:43 -07:00
cmd Fix 'zpool list -H' error code 2013-07-23 12:39:05 -07:00
config Fix arc_adapt() spinning in iterate_supers_type() 2013-07-17 09:28:06 -07:00
dracut Refresh dracut module setup 2013-03-21 12:51:06 -07:00
etc Improve OpenRC init script 2013-06-18 17:03:25 -07:00
include Remove arc_data_buf_alloc()/arc_data_buf_free() 2013-08-01 09:48:07 -07:00
lib Fix zpool_read_label() 2013-07-09 16:02:04 -07:00
man Fix man page for the sync property 2013-08-07 16:10:21 -07:00
module Return correct type and offset from zfs_readdir 2013-08-07 16:16:43 -07:00
patches Adding grub2 mkconfig support patch 2012-07-30 16:17:23 -07:00
rpm Add kmod repo integration 2013-08-01 09:48:07 -07:00
scripts Add kmod repo integration 2013-08-01 09:48:07 -07:00
udev Open pools asynchronously after module load 2013-07-03 09:24:38 -07:00
.gitignore Ignore *.{deb,rpm,tar.gz} files in the top directory. 2013-04-24 16:18:59 -07:00
AUTHORS Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
COPYRIGHT Refresh links to web site 2013-03-06 15:46:41 -08:00
DISCLAIMER Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
META Tag zfs-0.6.1 2013-03-26 08:50:29 -07:00
Makefile.am build: do not call boilerplate ourself 2013-04-02 10:55:20 -07:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README.markdown Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
autogen.sh build: do not call boilerplate ourself 2013-04-02 10:55:20 -07:00
configure.ac Modified arcstat.py to run on linux 2013-06-18 15:43:15 -07:00
copy-builtin Consistent menuconfig name 2012-08-26 13:49:37 -07:00
zfs-script-config.sh.in Retire zpool_id infrastructure 2013-01-29 12:23:17 -08:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

README.markdown

Native ZFS for Linux!

ZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the Illumos community.

ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers.

Full documentation for installing ZoL on your favorite Linux distribution can be found at: http://zfsonlinux.org