* [gentoo-commits] gentoo-x86 commit in sys-fs/zfs/files: zfs.service.in zfs-init.sh.in zfs-0.6.1-fix-zvol-initialization-r1.patch zfs-0.6.1-avoid-zdb-abort.patch zfs-0.6.1-fix-gcc-4.8-warning.patch
@ 2013-07-14 11:52 Richard Yao (ryao)
0 siblings, 0 replies; only message in thread
From: Richard Yao (ryao) @ 2013-07-14 11:52 UTC (permalink / raw
To: gentoo-commits
ryao 13/07/14 11:52:50
Added: zfs.service.in zfs-init.sh.in
zfs-0.6.1-fix-zvol-initialization-r1.patch
zfs-0.6.1-avoid-zdb-abort.patch
zfs-0.6.1-fix-gcc-4.8-warning.patch
Log:
Systemd support (bug #475872); Add python dependency to 9999 ebuild (bug #473788); Asynchronous zvol initialization; GCC 4.8 Compatibility Fix; Miscellaneous zdb fixes
(Portage version: 2.2.0_alpha187/cvs/Linux x86_64, signed Manifest commit with key 0xBEE84C64)
Revision Changes Path
1.1 sys-fs/zfs/files/zfs.service.in
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs.service.in?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs.service.in?rev=1.1&content-type=text/plain
Index: zfs.service.in
===================================================================
[Unit]
Description=ZFS filesystems setup
Before=network.target
After=systemd-udev-settle.target local-fs.target
[Service]
Type=oneshot
RemainAfterExit=true
ExecStartPre=/sbin/modprobe zfs
ExecStartPre=/usr/bin/test -c /dev/zfs
ExecStart=/usr/libexec/zfs-init.sh
ExecStop=@sbindir@/zfs umount -a
[Install]
WantedBy=multi-user.target
1.1 sys-fs/zfs/files/zfs-init.sh.in
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-init.sh.in?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-init.sh.in?rev=1.1&content-type=text/plain
Index: zfs-init.sh.in
===================================================================
#!/bin/sh
ZFS="@sbindir@/zfs"
ZPOOL="@sbindir@/zpool"
ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
if [ -f "${ZPOOL_CACHE}" ]; then
"${ZPOOL}" import -c "${ZPOOL_CACHE}" -aN 2>/dev/null
if [ "${?}" != "0" ]; then
echo "Failed to import not-yet imported pools." >&2
fi
fi
echo "Mounting ZFS filesystems"
"${ZFS}" mount -a
if [ "${?}" != "0" ]; then
echo "Failed to mount ZFS filesystems." >&2
exit 1
fi
echo "Exporting ZFS filesystems"
"${ZFS}" share -a
if [ "${?}" != "0" ]; then
echo "Failed to export ZFS filesystems." >&2
exit 1
fi
exit 0
1.1 sys-fs/zfs/files/zfs-0.6.1-fix-zvol-initialization-r1.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-fix-zvol-initialization-r1.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-fix-zvol-initialization-r1.patch?rev=1.1&content-type=text/plain
Index: zfs-0.6.1-fix-zvol-initialization-r1.patch
===================================================================
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index e986e92..65f78b7 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -64,6 +64,7 @@
#include <sys/zfs_ioctl.h>
#include <sys/dsl_scan.h>
#include <sys/zfeature.h>
+#include <sys/zvol.h>
#ifdef _KERNEL
#include <sys/bootprops.h>
@@ -2856,6 +2857,7 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
spa_load_state_t state = SPA_LOAD_OPEN;
int error;
int locked = B_FALSE;
+ int firstopen = B_FALSE;
*spapp = NULL;
@@ -2879,6 +2881,8 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
if (spa->spa_state == POOL_STATE_UNINITIALIZED) {
zpool_rewind_policy_t policy;
+ firstopen = B_TRUE;
+
zpool_get_rewind_policy(nvpolicy ? nvpolicy : spa->spa_config,
&policy);
if (policy.zrp_request & ZPOOL_DO_REWIND)
@@ -2953,6 +2957,11 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
mutex_exit(&spa_namespace_lock);
}
+#ifdef _KERNEL
+ if (firstopen)
+ zvol_create_minors(spa->spa_name);
+#endif
+
*spapp = spa;
return (0);
@@ -4010,6 +4019,10 @@ spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
mutex_exit(&spa_namespace_lock);
spa_history_log_version(spa, LOG_POOL_IMPORT);
+#ifdef _KERNEL
+ zvol_create_minors(pool);
+#endif
+
return (0);
}
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
index 1226b2c..a9184a1 100644
--- a/module/zfs/zfs_ioctl.c
+++ b/module/zfs/zfs_ioctl.c
@@ -1268,9 +1268,6 @@ zfs_ioc_pool_import(zfs_cmd_t *zc)
error = err;
}
- if (error == 0)
- zvol_create_minors(zc->zc_name);
-
nvlist_free(config);
if (props)
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
index 43a7bb6..e35c91b 100644
--- a/module/zfs/zvol.c
+++ b/module/zfs/zvol.c
@@ -1215,6 +1215,9 @@ zvol_alloc(dev_t dev, const char *name)
zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
+ spin_lock_init(&zv->zv_lock);
+ list_link_init(&zv->zv_next);
+
zv->zv_queue = blk_init_queue(zvol_request, &zv->zv_lock);
if (zv->zv_queue == NULL)
goto out_kmem;
@@ -1248,9 +1251,6 @@ zvol_alloc(dev_t dev, const char *name)
sizeof (rl_t), offsetof(rl_t, r_node));
zv->zv_znode.z_is_zvol = TRUE;
- spin_lock_init(&zv->zv_lock);
- list_link_init(&zv->zv_next);
-
zv->zv_disk->major = zvol_major;
zv->zv_disk->first_minor = (dev & MINORMASK);
zv->zv_disk->fops = &zvol_ops;
@@ -1561,30 +1561,36 @@ zvol_init(void)
{
int error;
+ list_create(&zvol_state_list, sizeof (zvol_state_t),
+ offsetof(zvol_state_t, zv_next));
+ mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
+
zvol_taskq = taskq_create(ZVOL_DRIVER, zvol_threads, maxclsyspri,
zvol_threads, INT_MAX, TASKQ_PREPOPULATE);
if (zvol_taskq == NULL) {
printk(KERN_INFO "ZFS: taskq_create() failed\n");
- return (-ENOMEM);
+ error = -ENOMEM;
+ goto out1;
}
error = register_blkdev(zvol_major, ZVOL_DRIVER);
if (error) {
printk(KERN_INFO "ZFS: register_blkdev() failed %d\n", error);
- taskq_destroy(zvol_taskq);
- return (error);
+ goto out2;
}
blk_register_region(MKDEV(zvol_major, 0), 1UL << MINORBITS,
THIS_MODULE, zvol_probe, NULL, NULL);
- mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
- list_create(&zvol_state_list, sizeof (zvol_state_t),
- offsetof(zvol_state_t, zv_next));
+ return (0);
- (void) zvol_create_minors(NULL);
+out2:
+ taskq_destroy(zvol_taskq);
+out1:
+ mutex_destroy(&zvol_state_lock);
+ list_destroy(&zvol_state_list);
- return (0);
+ return (error);
}
void
diff --git a/scripts/zconfig.sh b/scripts/zconfig.sh
index 141348c..281166c 100755
--- a/scripts/zconfig.sh
+++ b/scripts/zconfig.sh
@@ -264,8 +264,9 @@ test_4() {
zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9
- # Load the modules, wait 1 second for udev
+ # Load the modules, list the pools to ensure they are opened
${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 10
+ ${ZPOOL} list &>/dev/null
# Verify the devices were created
zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
diff --git a/udev/rules.d/90-zfs.rules.in b/udev/rules.d/90-zfs.rules.in
index 52e1d63..a2715d2 100644
--- a/udev/rules.d/90-zfs.rules.in
+++ b/udev/rules.d/90-zfs.rules.in
@@ -1,4 +1,4 @@
-SUBSYSTEM!="block", GOTO="zfs_end"
+SUBSYSTEM!="block|misc", GOTO="zfs_end"
ACTION!="add|change", GOTO="zfs_end"
ENV{ID_FS_TYPE}=="zfs", RUN+="/sbin/modprobe zfs"
@@ -7,4 +7,6 @@ ENV{ID_FS_TYPE}=="zfs_member", RUN+="/sbin/modprobe zfs"
KERNEL=="null", SYMLINK+="root"
SYMLINK=="null", SYMLINK+="root"
+SUBSYSTEM=="misc", KERNEL=="zfs", RUN+="@sbindir@/zpool list"
+
LABEL="zfs_end"
1.1 sys-fs/zfs/files/zfs-0.6.1-avoid-zdb-abort.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-avoid-zdb-abort.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-avoid-zdb-abort.patch?rev=1.1&content-type=text/plain
Index: zfs-0.6.1-avoid-zdb-abort.patch
===================================================================
From 5d3dc3fb72518a4c191e3a014622b74365eb3a74 Mon Sep 17 00:00:00 2001
From: Mike Leddy <mike.leddy@gmail.com>
Date: Thu, 4 Jul 2013 01:02:05 -0300
Subject: [PATCH] Avoid abort() in vn_rdwr(): libzpool/kernel.c
Make sure that buffer is aligned to 512 bytes on linux so that
pread call combined with O_DIRECT does not return EINVAL.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1570
---
cmd/zdb/zdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 936974b..a2b6bfe 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -2844,7 +2844,7 @@
psize = size;
lsize = size;
- pbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
+ pbuf = umem_alloc_aligned(SPA_MAXBLOCKSIZE, 512, UMEM_NOFAIL);
lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
BP_ZERO(bp);
--
1.8.1.6
1.1 sys-fs/zfs/files/zfs-0.6.1-fix-gcc-4.8-warning.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-fix-gcc-4.8-warning.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-fs/zfs/files/zfs-0.6.1-fix-gcc-4.8-warning.patch?rev=1.1&content-type=text/plain
Index: zfs-0.6.1-fix-gcc-4.8-warning.patch
===================================================================
From 3db3ff4a787acf068b122562fb5be5aecec2611f Mon Sep 17 00:00:00 2001
From: Richard Yao <ryao@gentoo.org>
Date: Tue, 2 Jul 2013 00:07:15 -0400
Subject: [PATCH] Use MAXPATHLEN instead of sizeof in snprintf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This silences a GCC 4.8.0 warning by fixing a programming error
caught by static analysis:
../../cmd/ztest/ztest.c: In function ‘ztest_vdev_aux_add_remove’:
../../cmd/ztest/ztest.c:2584:33: error: argument to ‘sizeof’
in ‘snprintf’ call is the same expression as the destination;
did you mean to provide an explicit length?
[-Werror=sizeof-pointer-memaccess]
(void) snprintf(path, sizeof (path), ztest_aux_template,
^
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1480
---
cmd/ztest/ztest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index b38d7b1..93a5f1e 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -2581,7 +2581,7 @@ enum ztest_object {
zs->zs_vdev_aux = 0;
for (;;) {
int c;
- (void) snprintf(path, sizeof (path), ztest_aux_template,
+ (void) snprintf(path, MAXPATHLEN, ztest_aux_template,
ztest_opts.zo_dir, ztest_opts.zo_pool, aux,
zs->zs_vdev_aux);
for (c = 0; c < sav->sav_count; c++)
--
1.8.1.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-14 11:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-14 11:52 [gentoo-commits] gentoo-x86 commit in sys-fs/zfs/files: zfs.service.in zfs-init.sh.in zfs-0.6.1-fix-zvol-initialization-r1.patch zfs-0.6.1-avoid-zdb-abort.patch zfs-0.6.1-fix-gcc-4.8-warning.patch Richard Yao (ryao)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox