Commit Graph

64 Commits

Author SHA1 Message Date
Brian Behlendorf 39f3185fed Merge branch 'linux-events' into refs/top-bases/linux-zfs-branch 2010-07-21 12:50:17 -07:00
Brian Behlendorf 5951864035 Minor formatting fix to align columns
$ sudo ./cmd/zpool/zpool events
TIME                           CLASS
Jul 21 2010 11:36:14.682122000 resource.fs.zfs.statechange
Jul 21 2010 11:36:14.705809000 resource.fs.zfs.statechange
2010-07-21 12:51:07 -07:00
Brian Behlendorf 9193fdea7e Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch 2010-06-14 16:10:54 -07:00
Brian Behlendorf 1b55fad32f Updates to linux-user-disk
The major change is removing the thread pool when importing devices.
This may be reintroduced at some point if needed, but it is added
complexity which has already been handled by blkid on modern Linux
systems.  We only need to fallback to probing everything is /dev/
if you config file is toast and even then it only takes a few seconds.
2010-06-14 15:59:11 -07:00
Brian Behlendorf c52a71873a Merge commit 'refs/top-bases/linux-events' into linux-events 2010-06-14 15:38:51 -07:00
Brian Behlendorf d860bca64c Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2010-06-14 15:37:52 -07:00
Brian Behlendorf e796e2a03e Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch 2010-06-14 15:37:10 -07:00
Brian Behlendorf b5ba75f385 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2010-06-14 15:37:03 -07:00
Brian Behlendorf dfe881c0ef Merge branch 'gcc-unused' into refs/top-bases/gcc-branch 2010-06-14 15:37:01 -07:00
Brian Behlendorf 1e7a75049a Merge branch 'gcc-uninit' into refs/top-bases/gcc-branch 2010-06-14 15:37:00 -07:00
Brian Behlendorf d8e123dc27 Update gcc-unused
Fix new instances or changes in gcc flagged unused code.  These are
mostly related to variables which are not used when debugging is
disabled and the ASSERTs are compiled out.
2010-06-14 15:29:48 -07:00
Brian Behlendorf b320a7bb4b Update gcc-unit
Fix new possibly uninitialized variables according to gcc.
2010-06-14 15:24:20 -07:00
Brian Behlendorf a054b40984 Merge branch 'linux-user-disk' into refs/top-bases/linux-zfs-branch
Conflicts:
	cmd/zpool/zpool_main.c
2010-05-28 22:20:07 -07:00
Brian Behlendorf b41143632b Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch
Conflicts:
	cmd/zpool/zpool_main.c
	cmd/zpool/zpool_vdev.c
	cmd/ztest/ztest.c
	lib/libzfs/libzfs_dataset.c
	lib/libzfs/libzfs_import.c
	lib/libzfs/libzfs_mount.c
	lib/libzfs/libzfs_pool.c
	lib/libzfs/libzfs_sendrecv.c
	lib/libzpool/include/sys/zfs_context.h
	module/zcommon/include/sys/fs/zfs.h
	module/zcommon/zfs_comutil.c
	module/zfs/arc.c
	module/zfs/dmu.c
	module/zfs/dmu_objset.c
	module/zfs/dmu_send.c
	module/zfs/dmu_tx.c
	module/zfs/dsl_dataset.c
	module/zfs/dsl_dir.c
	module/zfs/dsl_scrub.c
	module/zfs/fm.c
	module/zfs/include/sys/dmu.h
	module/zfs/include/sys/fm/fs/zfs.h
	module/zfs/include/sys/fm/protocol.h
	module/zfs/include/sys/spa.h
	module/zfs/include/sys/zfs_context.h
	module/zfs/include/sys/zfs_ioctl.h
	module/zfs/include/sys/zvol.h
	module/zfs/spa.c
	module/zfs/spa_boot.c
	module/zfs/spa_history.c
	module/zfs/spa_misc.c
	module/zfs/txg.c
	module/zfs/vdev.c
	module/zfs/zfs_fm.c
	module/zfs/zfs_ioctl.c
	module/zfs/zfs_replay.c
	module/zfs/zfs_znode.c
	module/zfs/zil.c
	module/zfs/zio.c
2010-05-28 22:14:39 -07:00
Brian Behlendorf 8c67d72771 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk
Conflicts:
	cmd/zpool/zpool_main.c
	cmd/zpool/zpool_vdev.c
	lib/libzfs/libzfs_dataset.c
	lib/libzfs/libzfs_import.c
	lib/libzfs/libzfs_mount.c
	lib/libzfs/libzfs_pool.c
2010-05-28 21:41:17 -07:00
Brian Behlendorf 7008960b9e Merge commit 'refs/top-bases/linux-events' into linux-events
Conflicts:
	lib/libzpool/include/sys/zfs_context.h
	module/zcommon/include/sys/fs/zfs.h
	module/zfs/dsl_scrub.c
	module/zfs/fm.c
	module/zfs/include/sys/fm/fs/zfs.h
	module/zfs/include/sys/fm/protocol.h
	module/zfs/include/sys/spa.h
	module/zfs/include/sys/zfs_context.h
	module/zfs/spa.c
	module/zfs/spa_misc.c
	module/zfs/vdev.c
	module/zfs/zfs_fm.c
2010-05-28 16:42:29 -07:00
Brian Behlendorf e27754d9e8 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch
Conflicts:
	cmd/ztest/ztest.c
	lib/libzfs/libzfs_sendrecv.c
	module/zfs/dmu_objset.c
	module/zfs/dnode.c
	module/zfs/dnode_sync.c
	module/zfs/dsl_dataset.c
	module/zfs/include/sys/dmu_tx.h
	module/zfs/include/sys/txg.h
	module/zfs/spa_history.c
2010-05-28 15:45:38 -07:00
Brian Behlendorf 97352d5103 Merge branch 'gcc-cast' into refs/top-bases/gcc-branch
Conflicts:
	cmd/zpool/zpool_main.c
	cmd/ztest/ztest.c
2010-05-28 15:37:31 -07:00
Brian Behlendorf 3e2be634a5 Merge branch 'gcc-c90' into refs/top-bases/gcc-branch
Conflicts:
	cmd/zdb/zdb.c
	cmd/zdb/zdb_il.c
	cmd/zfs/zfs_main.c
	cmd/zfs/zfs_util.h
	cmd/zinject/zinject.h
	cmd/zpool/zpool_main.c
	cmd/zpool/zpool_util.c
	cmd/ztest/ztest.c
	lib/libnvpair/include/libnvpair.h
	lib/libnvpair/libnvpair.c
	lib/libzfs/libzfs_changelist.c
	lib/libzfs/libzfs_config.c
	lib/libzfs/libzfs_dataset.c
	lib/libzfs/libzfs_import.c
	lib/libzfs/libzfs_mount.c
	lib/libzfs/libzfs_pool.c
	lib/libzfs/libzfs_sendrecv.c
	module/avl/avl.c
	module/avl/include/sys/avl.h
	module/nvpair/include/sys/nvpair.h
	module/nvpair/nvpair.c
	module/zcommon/include/zfs_comutil.h
	module/zcommon/include/zfs_prop.h
	module/zcommon/zfs_comutil.c
	module/zfs/arc.c
	module/zfs/dbuf.c
	module/zfs/dmu.c
	module/zfs/dmu_objset.c
	module/zfs/dmu_zfetch.c
	module/zfs/dnode_sync.c
	module/zfs/dsl_dataset.c
	module/zfs/dsl_pool.c
	module/zfs/dsl_prop.c
	module/zfs/dsl_synctask.c
	module/zfs/include/sys/dmu_tx.h
	module/zfs/include/sys/dmu_zfetch.h
	module/zfs/include/sys/dsl_synctask.h
	module/zfs/include/sys/refcount.h
	module/zfs/include/sys/txg.h
	module/zfs/include/sys/uberblock.h
	module/zfs/include/sys/zap_leaf.h
	module/zfs/include/sys/zfs_debug.h
	module/zfs/include/sys/zfs_znode.h
	module/zfs/include/sys/zio_compress.h
	module/zfs/include/sys/zvol.h
	module/zfs/lzjb.c
	module/zfs/metaslab.c
	module/zfs/refcount.c
	module/zfs/sha256.c
	module/zfs/spa.c
	module/zfs/spa_boot.c
	module/zfs/uberblock.c
	module/zfs/vdev.c
	module/zfs/zap_micro.c
	module/zfs/zfs_ioctl.c
	module/zfs/zfs_replay.c
	module/zfs/zio.c
	module/zfs/zio_compress.c
2010-05-28 15:34:57 -07:00
Brian Behlendorf cd47feb3c8 Merge commit 'refs/top-bases/gcc-uninit' into gcc-uninit
Conflicts:
	cmd/zpool/zpool_main.c
	cmd/ztest/ztest.c
	module/zfs/arc.c
2010-05-28 14:56:00 -07:00
Brian Behlendorf 475bf41d1c Merge commit 'refs/top-bases/gcc-cast' into gcc-cast
Conflicts:
	cmd/zfs/zfs_main.c
	cmd/zpool/zpool_main.c
	cmd/ztest/ztest.c
2010-05-28 14:36:18 -07:00
Brian Behlendorf 428870ff73 Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
Brian Behlendorf 542052314e Merge branch 'linux-events' into refs/top-bases/linux-zfs-branch 2010-05-21 15:35:53 -07:00
Brian Behlendorf 1573fc9932 Cast to (const time_t *) to fix compiler type warning. 2010-05-21 15:06:25 -07:00
Brian Behlendorf 14152c7b2c Merge branch 'linux-user-util' into refs/top-bases/linux-zfs-branch 2010-05-21 10:49:47 -07:00
Brian Behlendorf 868e5de066 Add linux-user-util topic branch.
This topic branch contains required changes to the user space
utilities to allow them to integrate cleanly with Linux.
2010-05-21 10:47:59 -07:00
Brian Behlendorf feb723fa7d Merge branch 'linux-events' into refs/top-bases/linux-zfs-branch 2010-05-14 12:55:10 -07:00
Brian Behlendorf 97d19a5e45 Add linux-events topic branch for zevent handling.
This topic branch leverages the Solaris style FMA call points
in ZFS to create a user space visible event notification system
under Linux.  This new system is called zevent and it unifies
all previous Solaris style ereports and sysevent notifications.

Under this Linux specific scheme when a sysevent or ereport event
occurs an nvlist describing the event is created which looks almost
exactly like a Solaris ereport.  These events are queued up in the
kernel when they occur and conditionally logged to the console.
It is then up to a user space application to consume the events
and do whatever it likes with them.

To make this possible the existing /dev/zfs ABI has been extended
with two new ioctls which behave as follows.

* ZFS_IOC_EVENTS_NEXT
Get the next pending event.  The kernel will keep track of the last
event consumed by the file descriptor and provide the next one if
available.  If no new events are available the ioctl() will block
waiting for the next event.  This ioctl may also be called in a
non-blocking mode by setting zc.zc_guid = ZEVENT_NONBLOCK.  In the
non-blocking case if no events are available ENOENT will be returned.
It is possible that ESHUTDOWN will be returned if the ioctl() is
called while module unloading is in progress.  And finally ENOMEM
may occur if the provided nvlist buffer is not large enough to
contain the entire event.

* ZFS_IOC_EVENTS_CLEAR
Clear are events queued by the kernel.  The kernel will keep a fairly
large number of recent events queued, use this ioctl to clear the
in kernel list.  This will effect all user space processes consuming
events.

The zpool command has been extended to use this events ABI with the
'events' subcommand.  You may run 'zpool events -v' to output a
verbose log of all recent events.  This is very similar to the
Solaris 'fmdump -ev' command with the key difference being it also
includes what would be considered sysevents under Solaris.  You
may also run in follow mode with the '-f' option.  To clear the
in kernel event queue use the '-c' option.

$ sudo cmd/zpool/zpool events -fv
TIME                        CLASS
May 13 2010 16:31:15.777711000 ereport.fs.zfs.config.sync
        class = "ereport.fs.zfs.config.sync"
        ena = 0x40982b7897700001
        detector = (embedded nvlist)
                version = 0x0
                scheme = "zfs"
                pool = 0xed976600de75dfa6
        (end detector)

        time = 0x4bec8bc3 0x2e5aed98
        pool = "zpios"
        pool_guid = 0xed976600de75dfa6
        pool_context = 0x0

While the 'zpool events' command is handy for interactive debugging
it is not expected to be the primary consumer of zevents.  This ABI
was primarily added to facilitate the addition of a user space
monitoring daemon.  This daemon would consume all events posted by
the kernel and based on the type of event perform an action.  For
most events simply forwarding them on to syslog is likely enough.
But this interface also cleanly allows for more sophisticated
actions to be taken such as generating an email for a failed drive
2010-05-14 12:40:44 -07:00
Brian Behlendorf aebe6818a9 Linux ZVOL implementation; user-side changes
At last a useful user space interface for the Linux ZFS port arrives.
With the addition of the ZVOL real ZFS based block devices are available
and can be compared head to head with Linux's MD and LVM block drivers.
The Linux ZVOL has not yet had any performance work done but from a user
perspective it should be functionally complete and behave like any other
Linux block device.

The ZVOL has so far been tested using zconfig.sh on the following x86_64
based platforms: FC11, CHAOS4, RHEL5, RHEL6, and SLES11.  However, more
testing is required to ensure everything is working as designed.

What follows in a somewhat detailed list of changes includes in this
commit to make ZVOL's possible.  A few other issues were addressed in
the context of these changes which will also be mentioned.

* zvol_create_link_common() simplified to simply issue to ioctl to
create the device and then wait up to 10 seconds for it to appear.
The device will be created within a few miliseconds by udev under
/dev/<pool>/<volume>.  Note this naming convention is slightly
different than on Solaris by I feel is more Linuxy.

* Removed support for dump vdevs.  This concept is specific to Solaris
and done not map cleanly to Linux.  Under Linux generating system cores
is perferably done over the network via netdump, or alternately to a
block device via O_DIRECT.
2009-11-20 12:00:08 -08:00
Brian Behlendorf 8a34963bec Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2009-10-23 12:28:10 -07:00
Brian Behlendorf edb22b6a3e Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2009-10-23 12:24:38 -07:00
Brian Behlendorf d8d360724d Merge branch 'gcc-uninit' into refs/top-bases/gcc-branch 2009-10-23 12:24:37 -07:00
Brian Behlendorf 5972702242 Add two more possible uninit vars flagged by gcc. 2009-10-23 11:43:09 -07:00
Brian Behlendorf 48d1b0c5ab Cleanly integrate ZFS tools with libblkid.
The majority of this this patch concerns itself with doing a direct
replacement of Solaris's libdiskmgt library with libblkid+libefi.
You'll notice that this patch removes all libdiskmgt code instead of
ifdef'ing it out.  This was done to minimize any confusion when reading
the code because it seems unlikely we will ever port libdiskmgt to Linux.

Despite the replacement the behavior of the tools should have remained
the same with one exception.  For the moment, we are unable to check
the partitions of devices which have an MBR style partition table when
creating a filesystem.  If a non-efi partition sceme is detected on a
whole disk device we prompt the user to explicity use the force option.
It would not be a ton of work to make the tool aware of MBR style
partitions if this becomes a problem.

I've done basic sanity checking for various configurations and all
the issues I'm aware of have been addressed.  Even things like blkid
misidentifing a disk as ext3 when it is added to a zfs pool.  I'm
careful to always zero out the first 4k of any new zfs partition.  That
all said this is all new code and while it looks like it's working right
for me we should keep an eye on it for any strange behavior.
2009-10-15 16:28:47 -07:00
Brian Behlendorf 8b02e1a43f Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2009-08-18 12:35:12 -07:00
Brian Behlendorf b99b422796 Merge branch 'gcc-branch' into refs/top-bases/zfs-branch 2009-08-18 12:08:58 -07:00
Brian Behlendorf c5b5d32d69 Merge commit 'refs/top-bases/gcc-uninit' into gcc-uninit
Conflicts:

	module/zfs/vdev_raidz.c
2009-08-18 12:06:21 -07:00
Brian Behlendorf 9e903015fd Merge commit 'refs/top-bases/gcc-cast' into gcc-cast 2009-08-18 12:05:07 -07:00
Brian Behlendorf e5e4fadc34 Merge branch 'gcc-c90' into refs/top-bases/gcc-branch
Conflicts:

	module/zfs/dmu.c
	module/zfs/dsl_deleg.c
	module/zfs/rrwlock.c
	module/zfs/vdev_raidz.c
2009-08-18 12:04:53 -07:00
Brian Behlendorf 45d1cae3b8 Rebase master to b121 2009-08-18 11:43:27 -07:00
Brian Behlendorf 409cfe5051 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk
Conflicts:

	lib/libzfs/libzfs_pool.c
2009-07-06 15:05:47 -07:00
Brian Behlendorf a1ccb00b7e Merge branch 'gcc-branch' into refs/top-bases/zfs-branch
Conflicts:

	cmd/ztest/ztest.c
	module/zfs/zil.c
2009-07-06 13:11:34 -07:00
Brian Behlendorf 44703f0029 Merge commit 'refs/top-bases/gcc-uninit' into gcc-uninit
Conflicts:

	lib/libzfs/libzfs_dataset.c
	module/zfs/arc.c
	module/zfs/spa.c
2009-07-02 16:57:09 -07:00
Brian Behlendorf b095bf444a Merge commit 'refs/top-bases/gcc-cast' into gcc-cast
Conflicts:

	cmd/zfs/zfs_main.c
	lib/libzfs/libzfs_dataset.c
2009-07-02 16:50:53 -07:00
Brian Behlendorf e2b2597751 Merge branch 'gcc-c90' into refs/top-bases/gcc-branch
Conflicts:

	cmd/zdb/zdb_il.c
	cmd/zfs/zfs_main.c
	cmd/zinject/zinject.c
	cmd/ztest/ztest.c
	lib/libzfs/libzfs_dataset.c
	lib/libzfs/libzfs_graph.c
	module/zcommon/include/sys/fm/fs/zfs.h
	module/zcommon/include/zfs_deleg.h
	module/zcommon/include/zfs_namecheck.h
	module/zcommon/zfs_deleg.c
	module/zcommon/zfs_namecheck.c
	module/zcommon/zprop_common.c
	module/zfs/arc.c
	module/zfs/dmu.c
	module/zfs/dmu_object.c
	module/zfs/dmu_objset.c
	module/zfs/dsl_pool.c
	module/zfs/dsl_prop.c
	module/zfs/fletcher.c
	module/zfs/include/sys/dsl_deleg.h
	module/zfs/include/sys/dsl_prop.h
	module/zfs/include/sys/metaslab_impl.h
	module/zfs/include/sys/spa_boot.h
	module/zfs/include/sys/zap.h
	module/zfs/include/sys/zap_impl.h
	module/zfs/include/sys/zfs_context.h
	module/zfs/include/sys/zfs_ctldir.h
	module/zfs/include/sys/zfs_dir.h
	module/zfs/include/sys/zfs_fuid.h
	module/zfs/include/sys/zfs_ioctl.h
	module/zfs/spa.c
	module/zfs/spa_errlog.c
	module/zfs/spa_history.c
	module/zfs/zap.c
	module/zfs/zap_leaf.c
	module/zfs/zap_micro.c
	module/zfs/zfs_ioctl.c
	module/zfs/zio.c
2009-07-02 16:49:11 -07:00
Brian Behlendorf 9babb37438 Rebase master to b117 2009-07-02 15:44:48 -07:00
Brian Behlendorf 10e245f03f Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk
Conflicts:
	cmd/zpool/zpool_main.c
2009-03-16 10:42:20 -07:00
Brian Behlendorf 5ee8a85ba6 Merge branch 'fix-branch' into refs/top-bases/zfs-branch 2009-03-16 10:30:27 -07:00
Brian Behlendorf 2924858552 Remove two self referential functions.
Newer versions of gcc (4.3.0) detected the following unused
code segments.
2009-03-16 10:02:06 -07:00
Brian Behlendorf fbbb5fe669 Merge commit 'refs/top-bases/linux-user-disk' into linux-user-disk 2009-03-12 10:40:09 -07:00