OpenZFS on Linux and FreeBSD
Go to file
Brian Behlendorf 9af7aa53eb Set stack frame limit
For all module/library functions ensure so stack frame exceeds 1024
bytes.  Ideally this should be set lower to say 512 bytes but there
are still numerous functions which exceed even this limit.  For now
this is set to 1024 to ensure we catch the worst offenders.

Additionally, set the limit for ztest to 1024 bytes since the idea
here is to catch stack issues in user space before we find them by
overrunning a kernel stack.  This should also be reduced to 512
bytes as soon as all the trouble makes are fixed.

Finally, add -fstack-check to gcc build options when --enable-debug
is specified at configure time.  This ensures that each page on the
stack will be touched and we will generate a segfault on stack
overflow.

Over time we can gradually fix the following functions:

536 zfs:dsl_deadlist_regenerate
536 zfs:dsl_load_sets
536 zfs:zil_parse
544 zfs:zfs_ioc_recv
552 zfs:dsl_deadlist_insert_bpobj
552 zfs:vdev_dtl_sync
584 zfs:copy_create_perms
608 zfs:ddt_class_contains
608 zfs:ddt_prefetch
608 zfs:__dprintf
616 zfs:ddt_lookup
648 zfs:dsl_scan_ddt
696 zfs:dsl_deadlist_merge
736 zfs:ddt_zap_walk
744 zfs:dsl_prop_get_all_impl
872 zfs:dnode_evict_dbufs
2010-06-29 10:08:48 -07:00
cmd Set stack frame limit 2010-06-29 10:08:48 -07:00
config Set stack frame limit 2010-06-29 10:08:48 -07:00
etc Remove promise example config replace with a supermicro config 2010-03-11 14:04:12 -08:00
lib Set stack frame limit 2010-06-29 10:08:48 -07:00
man Add man pages to the build system and packages. 2009-12-11 16:49:25 -08:00
module Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-06-28 10:36:20 -07:00
patches Add e2fsprogs patch for detecting ZFS uberblocks until it appears upstream. 2009-11-02 15:04:43 -08:00
scripts Merge commit 'refs/top-bases/zfs-branch' into zfs-branch 2010-05-28 15:46:10 -07:00
.gitignore Ignore unsigned module build products 2010-03-09 14:14:09 -08:00
.topdeps New TopGit dependency: fix-stack-dmu_objset_snapshot 2010-06-16 14:39:39 -07:00
.topmsg Add fix-stack-dmu_objset_snapshot topic branch 2010-06-16 14:39:06 -07:00
AUTHORS Add AUTHORS to master branch 2010-05-18 14:55:01 -07:00
COPYING Revert accidental change to COPYING, move authors to master branch. 2010-05-18 14:41:47 -07:00
COPYRIGHT Update COPYRIGHT to reference zpios CDDL exceptions. 2010-05-18 14:25:28 -07:00
ChangeLog Prep for 0.4.9 tag update META, README, ChangeLog. 2010-05-21 15:11:49 -07:00
DISCLAIMER Resolve conflict 2010-05-18 10:42:54 -07:00
GIT Refresh type in topgit git://* reference 2009-01-26 21:58:32 -08:00
META Update META to version 0.5.0 2010-06-14 15:45:23 -07:00
Makefile.am Ensure COPYRIGHT file is included in the package. 2010-05-21 16:34:38 -07:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README Prep for 0.4.9 tag update META, README, ChangeLog. 2010-05-21 15:11:49 -07:00
ZFS.RELEASE Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
autogen.sh Core target arch support for conditional compilation of SUBDIRs 2009-06-08 16:07:43 -07:00
configure.ac Add support for 'make -s' silent builds 2010-03-26 15:41:41 -07:00
zfs-modules.spec.in Minor spec file cleanup for RHEL6 package dependency. 2010-05-21 15:08:08 -07:00
zfs.spec.in Remove TODO file for spec file. 2010-05-21 15:40:24 -07:00

README

============================ ZFS QUICK START ============================

1) Build the SPL (Solaris Porting Layer) and install it.  This package
   provides several Solaris APIs used by ZFS and is a required dependency.
   Before building ZFS build this package and install the resulting rpms.

> tar -xzf spl-x.y.z.tgz
> cd spl-x.y.z
> ./configure --with-linux=<kernel src>
> make
> make rpm

> sudo rpm -Uvh *.<arch>.rpm
Preparing...                ########################################### [100%]
   1:spl                    ########################################### [ 33%]
   2:spl-modules-devel      ########################################### [ 67%]
   3:spl-modules            ########################################### [100%]


2) Build ZFS and install it.  This package provides the native port of
   ZFS for Linux including all kernel modules and command line utilities.
   Note it is important that you have installed spl-module-devel package
   from step 1) before attempting to build ZFS.

> tar -xzf zfs-x.y.z.tgz
> cd zfs-x.y.z
> ./configure --with-linux=<kernel src>
> make
> make rpm

> sudo rpm -Uvh *.<arch>.rpm
Preparing...                ########################################### [100%]
   1:zfs                    ########################################### [ 20%]
   2:zfs-test               ########################################### [ 40%]
   3:zfs-modules-devel      ########################################### [ 60%]
   4:zfs-modules            ########################################### [ 80%]


3) Enjoy ZFS on Linux!  Currently only the ZVOL is fully functional
   but work on the ZPL is underway.  Why is just having the ZVOL still
   useful you ask?  Well here's an example of what you can do today using
   just the ZVOL:

> # Create the 'tank' zpool containing a raidz vdev spread over 4 devices.
> zpool create tank raidz /dev/sdb /dev/sdc /dev/sdd /dev/sde
> zpool list
NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
tank  1.81T   132K  1.81T     0%  ONLINE  -

> # Create a 100G block device named 'fish' in the 'tank' zpool.
> zfs create -V 100G tank/fish
> zfs list
NAME        USED  AVAIL  REFER  MOUNTPOINT
tank        100G  1.24T  26.9K  /tank
tank/fish   100G  1.33T  23.9K  -

> # Partition 'tank/fish' as if it were a normal block device.
> sfdisk /dev/tank/fish << EOF
0,
EOF
> sfdisk -l /dev/tank/fish

Disk /dev/tank/fish: 208050 cylinders, 16 heads, 63 sectors/track
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/tank/fish1          0+ 208049  208050- 104857199+  83  Linux
/dev/tank/fish2          0       -       0          0    0  Empty
/dev/tank/fish3          0       -       0          0    0  Empty
/dev/tank/fish4          0       -       0          0    0  Empty

> # Format the new /dev/tank/fish1 partition with ext2 and mount it.
> mkfs.ext2 -q /dev/tank/fish1
> mkdir -p /mnt/tank/fish1
> mount /dev/tank/fish1 /mnt/tank/fish1
> ls /mnt/tank/fish1
lost+found

> # Take a snapshot of the pristine ext2 filesystem and mount it read-only.
> zfs snapshot tank/fish@pristine
> mkdir /mnt/tank/fish@pristine1
> mount /dev/tank/fish@pristine1 /mnt/tank/fish@pristine1
> ls /mnt/tank/fish\@pristine1
lost+found

> # Changes made to tank/fish1 do not appear in tank/fish@pristine1
> touch /mnt/tank/fish1/foo
> ls /mnt/tank/fish1/
foo  lost+found
> ls /mnt/tank/fish\@pristine1
lost+found


Enjoy,
Brian Behlendorf <behlendorf1@llnl.gov>