mirror_zfs/lib/libzfs
Brian Behlendorf ff3510c1a5 Fix zpool_read_label()
The zpool_read_label() function was subtly broken due to a
difference of behavior in fstat64(2) on Solaris vs Linux.

Under Solaris when a block device is stat'ed the st_size
field will contain the size of the device in bytes.  Under
Linux this is only true for regular file and symlinks.  A
compatibility function called fstat64_blk(2) was added
which can be used when the Solaris behavior is required.

This flaw was never noticed because the only time we would
need to use the device size is when the first two labels
are damaged.  I noticed this issue while adding the
zpool_clear_label() function which is similar in design
and does require us to write all the labels.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2013-07-09 16:02:04 -07:00
..
libzfs_changelist.c Recreate minors when renaming zvols 2012-11-19 16:59:44 -08:00
libzfs_config.c Illumos #2619 and #2747 2013-01-08 10:35:35 -08:00
libzfs_dataset.c Add snapdev=[hidden|visible] dataset property 2013-03-05 12:37:54 -08:00
libzfs_diff.c Use strerror() not strerror_r() 2013-01-28 10:02:38 -08:00
libzfs_fru.c Add linux topology support 2010-08-31 13:42:00 -07:00
libzfs_graph.c Fix gcc missing braces warnings 2010-08-27 15:34:03 -07:00
libzfs_import.c Fix zpool_read_label() 2013-07-09 16:02:04 -07:00
libzfs_iter.c Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00
libzfs_mount.c Implemented sharing datasets via SMB using libshare 2012-12-03 09:42:15 -08:00
libzfs_pool.c Add FreeBSD 'zpool labelclear' command 2013-07-09 15:58:05 -07:00
libzfs_sendrecv.c Illumos #2703: add mechanism to report ZFS send progress 2012-09-19 13:39:06 -07:00
libzfs_status.c Illumos #2762: zpool command should have better support for feature flags 2013-01-08 10:35:43 -08:00
libzfs_util.c Add error message for missing /etc/mtab 2013-06-27 14:43:37 -07:00
Makefile.am Illumos #1644, #1645, #1646, #1647, #1708 2012-07-31 09:25:30 -07:00