diff options
author | Richard Yao <ryao@gentoo.org> | 2012-12-11 19:42:30 +0000 |
---|---|---|
committer | Richard Yao <ryao@gentoo.org> | 2012-12-11 19:42:30 +0000 |
commit | 7740372eb923d19e7799f3b34b1b71a8971bd60d (patch) | |
tree | d42f9823674f355948f4c6c2399f6e85c769bf54 /sys-kernel | |
parent | Bump. (diff) | |
download | historical-7740372eb923d19e7799f3b34b1b71a8971bd60d.tar.gz historical-7740372eb923d19e7799f3b34b1b71a8971bd60d.tar.bz2 historical-7740372eb923d19e7799f3b34b1b71a8971bd60d.zip |
Linux 3.7 Support; Linux 3.6 Stability Fix
Package-Manager: portage-2.1.11.31/cvs/Linux x86_64
Diffstat (limited to 'sys-kernel')
-rw-r--r-- | sys-kernel/spl/ChangeLog | 12 | ||||
-rw-r--r-- | sys-kernel/spl/Manifest | 8 | ||||
-rw-r--r-- | sys-kernel/spl/files/spl-0.6.0_rc12-fix-3.6-compat-regression.patch | 33 | ||||
-rw-r--r-- | sys-kernel/spl/files/spl-0.6.0_rc12-fix-race-in-slabs.patch | 47 | ||||
-rw-r--r-- | sys-kernel/spl/files/spl-0.6.0_rc12-linux-3.7-compat.patch | 381 | ||||
-rw-r--r-- | sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild (renamed from sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild) | 3 | ||||
-rw-r--r-- | sys-kernel/spl/spl-0.6.0_rc12-r1.ebuild | 98 |
7 files changed, 578 insertions, 4 deletions
diff --git a/sys-kernel/spl/ChangeLog b/sys-kernel/spl/ChangeLog index 16ae6ab9e3c9..4dee2f5e2894 100644 --- a/sys-kernel/spl/ChangeLog +++ b/sys-kernel/spl/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-kernel/spl # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.32 2012/11/14 21:56:51 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/ChangeLog,v 1.33 2012/12/11 19:42:28 ryao Exp $ + +*spl-0.6.0_rc12-r1 (11 Dec 2012) +*spl-0.6.0_rc11-r2 (11 Dec 2012) + + 11 Dec 2012; Richard Yao <ryao@gentoo.org> + +files/spl-0.6.0_rc12-fix-3.6-compat-regression.patch, + +files/spl-0.6.0_rc12-fix-race-in-slabs.patch, + +files/spl-0.6.0_rc12-linux-3.7-compat.patch, +spl-0.6.0_rc11-r2.ebuild, + +spl-0.6.0_rc12-r1.ebuild, -spl-0.6.0_rc11-r1.ebuild: + Linux 3.7 Support; Linux 3.6 Stability Fix *spl-0.6.0_rc12 (14 Nov 2012) diff --git a/sys-kernel/spl/Manifest b/sys-kernel/spl/Manifest index 2b2f066a58b2..b2e91d163762 100644 --- a/sys-kernel/spl/Manifest +++ b/sys-kernel/spl/Manifest @@ -1,12 +1,16 @@ AUX spl-0.6.0_rc11-linux-3.6-compat.patch 7545 SHA256 babec54aa933e2bf3b068f50a252dc7802a4ab6ff3815c7280c438b032c0305a SHA512 9331e989f9d78acaaeeade1c52ab5724af24ed063c4a327244c3380cc12ba6155ce55fbaa8c8a1a3e5fe662773726ef8d2768c58a7da5bec0e195198b6dfa4eb WHIRLPOOL 29b80515a9f45d232569770b18057926b183f7115d63f82572342ae3f1b97042403cdc58eea434a9ca029e9ea6aea0dd7cd66e1f6a8e97ba5d3f9a7a2fa92008 +AUX spl-0.6.0_rc12-fix-3.6-compat-regression.patch 1005 SHA256 6c245b2477532fa215da104813157be6c0aefbd7f31f008a8b7f8107b8f8a49f SHA512 7a14a020fc7320edb7c2486bf1fa2fbf79a0445083c711e2c7f2dadd77d784bccda299bc647e99a6dc19b9d51b5b01bf11d7365337904215f5c7f0fefbbf7028 WHIRLPOOL cfa5847876458f979f2d162ec8d4cc04acf5a92f1b3ddc3b0b74342ee947b770851296698fbf345813664454c24cc388a8724b208013c0532a7b8022f6e63f51 +AUX spl-0.6.0_rc12-fix-race-in-slabs.patch 1822 SHA256 6375b164125e1a7a8e022b09405eb3cef911f5ce40840d8ddfde39fcd21c79a7 SHA512 2401082aab5747d957b49f17ab08cbc0565597eacf48a58def0cb8043903c929a5d6cbde09ac833e1ff56fef291e50fe50e3e41b2b5719a392fe5ff382e298b4 WHIRLPOOL 985986edb62dbec2a7ae4ac7338d31a1c02c175fa2b550506785207ccbddf32410b9b79eb878ca395ff77b030b6a8db532440521637e3dfb4ba33f189df5c1ea +AUX spl-0.6.0_rc12-linux-3.7-compat.patch 12915 SHA256 f28d19df37718def641649b90ace5a00063bd9789e999cfcf696fe6374492123 SHA512 9352eb2bc7733dd029cf5ecd17c0e1a981ca65e839fffc367c9f6e786c0a374f797a70e6439d026999b31e824de0b97eab7ef5fb324c626964758d48eb5549a2 WHIRLPOOL 2af6b22e0ab0960cd923403f96ec7752a10c19efbf611b2c24f72d75b302aa6de4c1ee32f2af44a03e65fb17baab92574a4b667b13746538c7cdd2dc2540c48c AUX spl-0.6.0_rc9-alias-km-sleep-with-km-pushpage.patch 2071 SHA256 d34d56201046c6464141c50c815a956e200260c4b17a057af2dde6fdb5fcf949 SHA512 8decd4a803b85b46b5c241eeb0dd7b44e0491a972b08094d763a20d5ef21624ff0bbe79e56098600702f78f506e842c8bbfc3bc94067b86531399b0ba0b4285e WHIRLPOOL 5fbe166099b10e1281e5d824e25acd7f4467766d865e6c297dd8b503906b12bc63221babb0fb6e9fade65679a8637489cec16ac3e6e14d54457c9cda858db9db DIST spl-0.6.0-rc10.tar.gz 523189 SHA256 b25a748b18522f38b495f3577905ccd296f2782d1180140a05bd1efa19113ea0 SHA512 c5a01c9d42afcc3c4069b771fed2cbdc20d621994d2709a06057d93aeecc1b15c442cf5bce4cced90ecf7ac841f610e0b55b678e2bde8b853aeefac4402baf19 WHIRLPOOL 961edac42c35b1ecf65748eb2fc9876ed8cf1207307eedaba41a381e519589859ad5bbe468f7b94d563ec954e10c47237b4540f63a7ea211bbf9d92158f06b11 DIST spl-0.6.0-rc11.tar.gz 521190 SHA256 0f39edfb87c444781080e6f60acbd1094e3113cfc85a23d4e997fe0d53ce3a2f SHA512 d85dd2b10f98028ebc77069e63fd54241d7e8290cf81856cfb82648279e736ce108bc02b21993a87b8e8a046c3a3f37c0a3ede4cd32a4fa6be032316b47c5add WHIRLPOOL d49b863321173fa8effdaa338df4b8171e8db54f11b5f789a618ffa6abbdfcba721d2d38c59bac77786fb2d64096ed1e8f65a42f7ad2ab37a581d5e2493c05cb DIST spl-0.6.0-rc12.tar.gz 546842 SHA256 5352ecfa3bed7807bf4b154121c7f6349d986fea44125bd171240985ef28c898 SHA512 d71db7cc6e8ddec13f90a089a60d9b024f16576ed47b5458b88b7a8efad833b95219d9802c57edf76bfa77e65fd523e31aa768a37f8cd4036c828e7e4cf0534d WHIRLPOOL c6adccbcb9e7c30bead63b94168fc6348cd25ce3348e9e8191797b4100481fb727633760692c8aebb263062b393ae843aeb97718d106ac611e6664d1c5d475b3 EBUILD spl-0.6.0_rc10.ebuild 2173 SHA256 22f79dcb950c2e5747d0808950eb0140b57f5addb25830a51cb432f0cb0c477b SHA512 fd8b303a4b5bb34a418e59d00c396541c9655607b113ed29b5185eed74aed52b819723a5f56a7c3f0330a89f25e83c6b1f9899f26494d015f1e6129b592f03c0 WHIRLPOOL 37c213e141f6f1d08921d48944498c4e789f713e905b716c52ba73ee914ecf4d9fd2adc6921af0ad3cda754e51c534b1a1f1ac04df7b9ecfb23459e01299a03e -EBUILD spl-0.6.0_rc11-r1.ebuild 2158 SHA256 33eeeaae00b3bcb4ccd70571743c5c971f7f75a7c2fcdb49c1e05c7e37e99077 SHA512 a60db67a05ea7b841812be0d1a97dcf499e69ca978b1181f427dfd97c776eafd63addb4e2b6b31527b74a64b3cdc09775b3818b00f8a5db31620615d893efc15 WHIRLPOOL 65283ca5dcdf4a03a7ac09baebc0b2d7ea5ec0603efb84943cb0f99a675e187a0099f6404d2a7155d72a9d9fbb904b0980c6b6de9b61805e63093189a1285ebd +EBUILD spl-0.6.0_rc11-r2.ebuild 2229 SHA256 d57339825e283f2a61eec27d9a39cc9977099cbd02f2df721b8675a1136b7b8c SHA512 91d6de97c268d90a682af320eb5d984427465a3ef894eb52a5d509794afc8d0e2e59de1a4ae93b3429711e3e3d1bf0e50bd2f39b2647a5ce38300f44c041989b WHIRLPOOL d831f4619292ec006b1d36c9251eff86b9a941e2292e0f64af6bde1af46bad3eb2606ea683a71009e17db2c0c29d0d0ef87eab65a4cf6de64dc9a8adb7a6e71e EBUILD spl-0.6.0_rc11.ebuild 2083 SHA256 d7b10b5b7767cf6eac40954138a75d936927c78144f97b912d9991fcb0ca0f06 SHA512 ec387f0770bfaa8f23ba76f571e8ded8c33a909008d791b10fbc23d7fa9458f8923ec708d0662818443923c8c08920186f1519e94cfe169b6fdb101adb9eee84 WHIRLPOOL f3df9e269f70b620f5d0955ca29812eb18f9506e6a506d4f7d31e8f4ac2e6783b9a12e34037701c3a7d73a30aeb1e755780ee1e51faff3006c11cb10bb042d52 +EBUILD spl-0.6.0_rc12-r1.ebuild 2308 SHA256 87112a5246f33081035a591aed7fd078d44a582feda7a9fd7153a79837eae314 SHA512 4bb4f3f82f758a14a22c65e653c861b53ac4fb4dd15f06395041582020468a68dca74103306671e110643bca37ab4cb5c7189de23c589027183ad29de0839c0c WHIRLPOOL 6f162d80a64da4d39f37d3980079f600951c7a0824a666c9b5f783c385ccba879a1c6ef52516139a056c8ad495c4446e04b0d66bc0b354e30b7de071cac5bc2b EBUILD spl-0.6.0_rc12.ebuild 2083 SHA256 c72c9a07d7e26edca8db3404b0ebb1cc90eb8df4b56d6e3b8a600113144f0e23 SHA512 019e47f9ea77e9709c424e43f99759c0a853f769e0cc3a1083413ac050ca3b11e5c57e8955ac621591d64396c48b32ab2d3d82152106b548f5319bfba7b48d46 WHIRLPOOL f481c1ad3e47f7b4b286acfdb64da6147d36feb26c418aa46321ffae97205c314dda4087b2a362b1aa8dce291ad751a8119279e55580810d8a69b6306810b738 EBUILD spl-9999.ebuild 2078 SHA256 a2a38851d4edd1a04063e6b90beb370d2f9292632080e95e21cc1dfe97948fc1 SHA512 b686a18265d9f0e00b9878d7743086faae7323cd29fb2dc0aa90cf1fc119a4f95e32ef688c1e56ebb4b99c8f331ce6f9b70fafc96e91df12c753d25fb2b1a7a2 WHIRLPOOL 48e1fce6b69f4749795a256ea30a7ed96d0f13057fdc9010260266c48934e10f07535615913675b11e2b1f7d559e7727a84077b43cd0daa7fe83679508ce1224 -MISC ChangeLog 4901 SHA256 fec3e58c136ea11c701e4b59cecb7ab4a55cd15bb4ee9a34492e688feb2f63bb SHA512 8fc4fc0661197607233cb9f8e70626e2698e64504bdb8bf1bc0c01111486b5925bcc61b992432af4674b2018cc08e16400d42a8e2c512aa5ef4d20044a021ba9 WHIRLPOOL 3e1e49e17dc6ec950ec7a568d137f52fc21adf2299d792a718169e55e1cc9036df7e8584a9a1e1db35970209a3dac79eef681d911303980a275297386670170e +MISC ChangeLog 5296 SHA256 0c9950749e17c43f76c1a06441ee784c9a350c1227d5e9673d339f89e7810666 SHA512 edface90d59de191c880eac54cfa6063c77cf8e4a50ea6556949be1e6ad1ba866d2e04d5c3ef6a582567556b6bc19c033587e9dbda40188e64b47716119243b1 WHIRLPOOL 489357dd569fb2147b99df4b908fb7fb3e8a9bbcb2e1a14193835fe9b46c7fec11e94f20289c0f3baeb3c8e163263bf647729afa38cd4977ee3bb567c587c1d1 MISC metadata.xml 228 SHA256 a317cd066ed83c5b5acf9d49869cb2f153499bb90cee389334bee9781534f5e8 SHA512 1638d4580908d32ad6fad71d109a58d699c9111d26c1073ae95b20248fc2a5da91a1f73153f01942df25c64865586e970e6532a312cd374d9866bf21264ddc54 WHIRLPOOL 11e5655c66af420e31f60d3ab19ef3ff55222271dd63bca94b548c7a63bbc73e8edfb4d80648d143c7d8315f8ba66bc4140dcf97ff85ea472e2a7cab1de98264 diff --git a/sys-kernel/spl/files/spl-0.6.0_rc12-fix-3.6-compat-regression.patch b/sys-kernel/spl/files/spl-0.6.0_rc12-fix-3.6-compat-regression.patch new file mode 100644 index 000000000000..df024a6bcd81 --- /dev/null +++ b/sys-kernel/spl/files/spl-0.6.0_rc12-fix-3.6-compat-regression.patch @@ -0,0 +1,33 @@ +From 053678f3b0572db442551dfa547dea939f45c96b Mon Sep 17 00:00:00 2001 +From: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Mon, 3 Dec 2012 12:01:28 -0800 +Subject: [PATCH] Handle errors from spl_kern_path_locked() + +When the Linux 3.6 KERN_PATH_LOCKED compatibility code was added +by commit bcb1589 an entirely new vn_remove() implementation was +added. That function did not properly handle an error from +spl_kern_path_locked() which would result in an panic. This +patch addresses the issue by returning the error to the caller. + +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Closes #187 +--- + module/spl/spl-vnode.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c +index a0fed32..0ecd9ad 100644 +--- a/module/spl/spl-vnode.c ++++ b/module/spl/spl-vnode.c +@@ -332,6 +332,8 @@ + rc = vfs_unlink(parent.dentry->d_inode, dentry); + exit1: + dput(dentry); ++ } else { ++ return (-rc); + } + + spl_inode_unlock(parent.dentry->d_inode); +-- +1.7.10 + diff --git a/sys-kernel/spl/files/spl-0.6.0_rc12-fix-race-in-slabs.patch b/sys-kernel/spl/files/spl-0.6.0_rc12-fix-race-in-slabs.patch new file mode 100644 index 000000000000..41b14c55c085 --- /dev/null +++ b/sys-kernel/spl/files/spl-0.6.0_rc12-fix-race-in-slabs.patch @@ -0,0 +1,47 @@ +From 043f9b57247eafb8e28e7b9465470ece87090228 Mon Sep 17 00:00:00 2001 +From: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Mon, 26 Nov 2012 16:52:28 -0800 +Subject: [PATCH] Disable FS reclaim when allocating new slabs + +Allowing the spl_cache_grow_work() function to reclaim inodes +allows for two unlikely deadlocks. Therefore, we clear __GFP_FS +for these allocations. The two deadlocks are: + +* While holding the ZFS_OBJ_HOLD_ENTER(zsb, obj1) lock a function + calls kmem_cache_alloc() which happens to need to allocate a + new slab. To allocate the new slab we enter FS level reclaim + and attempt to evict several inodes. To evict these inodes we + need to take the ZFS_OBJ_HOLD_ENTER(zsb, obj2) lock and it + just happens that obj1 and obj2 use the same hashed lock. + +* Similar to the first case however instead of getting blocked + on the hash lock we block in txg_wait_open() which is waiting + for the next txg which isn't coming because the txg_sync + thread is blocked in kmem_cache_alloc(). + +Note this isn't a 100% fix because vmalloc() won't strictly +honor __GFP_FS. However, it practice this is sufficient because +several very unlikely things must all occur concurrently. + +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Issue zfsonlinux/zfs#1101 +--- + module/spl/spl-kmem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c +index f3113e0..b171d44 100644 +--- a/module/spl/spl-kmem.c ++++ b/module/spl/spl-kmem.c +@@ -1773,7 +1773,7 @@ static int spl_cache_flush(spl_kmem_cache_t *skc, + + atomic_inc(&skc->skc_ref); + ska->ska_cache = skc; +- ska->ska_flags = flags; ++ ska->ska_flags = flags & ~__GFP_FS; + spl_init_delayed_work(&ska->ska_work, spl_cache_grow_work, ska); + schedule_delayed_work(&ska->ska_work, 0); + } +-- +1.7.10 + diff --git a/sys-kernel/spl/files/spl-0.6.0_rc12-linux-3.7-compat.patch b/sys-kernel/spl/files/spl-0.6.0_rc12-linux-3.7-compat.patch new file mode 100644 index 000000000000..d06b031466f8 --- /dev/null +++ b/sys-kernel/spl/files/spl-0.6.0_rc12-linux-3.7-compat.patch @@ -0,0 +1,381 @@ +From b84412a6e8a1d22780a8203e00049c6e43efacac Mon Sep 17 00:00:00 2001 +From: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Fri, 30 Nov 2012 15:46:30 -0800 +Subject: [PATCH] Linux compat 3.7, kernel_thread() + +The preferred kernel interface for creating threads has been +kthread_create() for a long time now. However, several of the +SPLAT tests still use the legacy kernel_thread() function which +has finally been dropped (mostly). + +Update the condvar and rwlock SPLAT tests to use the modern +interface. Frankly this is something we should have done a +long time ago. + +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Closes #194 +--- + module/splat/splat-condvar.c | 70 +++++++++++++++++++++--------------------- + module/splat/splat-rwlock.c | 57 ++++++++++++++++------------------ + 2 files changed, 61 insertions(+), 66 deletions(-) + +diff --git a/module/splat/splat-condvar.c b/module/splat/splat-condvar.c +index 69fefc9..1fe306c 100644 +--- a/module/splat/splat-condvar.c ++++ b/module/splat/splat-condvar.c +@@ -24,6 +24,7 @@ + * Solaris Porting LAyer Tests (SPLAT) Condition Variable Tests. + \*****************************************************************************/ + ++#include <linux/kthread.h> + #include <sys/condvar.h> + #include "splat-internal.h" + +@@ -51,20 +52,20 @@ + #define SPLAT_CONDVAR_TEST5_DESC "Timeout thread, cv_wait_timeout()" + + #define SPLAT_CONDVAR_TEST_MAGIC 0x115599DDUL +-#define SPLAT_CONDVAR_TEST_NAME "condvar_test" ++#define SPLAT_CONDVAR_TEST_NAME "condvar" + #define SPLAT_CONDVAR_TEST_COUNT 8 + + typedef struct condvar_priv { +- unsigned long cv_magic; +- struct file *cv_file; ++ unsigned long cv_magic; ++ struct file *cv_file; + kcondvar_t cv_condvar; + kmutex_t cv_mtx; + } condvar_priv_t; + + typedef struct condvar_thr { +- int ct_id; + const char *ct_name; + condvar_priv_t *ct_cvp; ++ struct task_struct *ct_thread; + int ct_rc; + } condvar_thr_t; + +@@ -73,20 +74,17 @@ + { + condvar_thr_t *ct = (condvar_thr_t *)arg; + condvar_priv_t *cv = ct->ct_cvp; +- char name[16]; + + ASSERT(cv->cv_magic == SPLAT_CONDVAR_TEST_MAGIC); +- snprintf(name, sizeof(name),"%s%d",SPLAT_CONDVAR_TEST_NAME,ct->ct_id); +- daemonize(name); + + mutex_enter(&cv->cv_mtx); + splat_vprint(cv->cv_file, ct->ct_name, +- "%s thread sleeping with %d waiters\n", +- name, atomic_read(&cv->cv_condvar.cv_waiters)); ++ "%s thread sleeping with %d waiters\n", ++ ct->ct_thread->comm, atomic_read(&cv->cv_condvar.cv_waiters)); + cv_wait(&cv->cv_condvar, &cv->cv_mtx); + splat_vprint(cv->cv_file, ct->ct_name, +- "%s thread woken %d waiters remain\n", +- name, atomic_read(&cv->cv_condvar.cv_waiters)); ++ "%s thread woken %d waiters remain\n", ++ ct->ct_thread->comm, atomic_read(&cv->cv_condvar.cv_waiters)); + mutex_exit(&cv->cv_mtx); + + return 0; +@@ -96,7 +94,6 @@ + splat_condvar_test1(struct file *file, void *arg) + { + int i, count = 0, rc = 0; +- long pids[SPLAT_CONDVAR_TEST_COUNT]; + condvar_thr_t ct[SPLAT_CONDVAR_TEST_COUNT]; + condvar_priv_t cv; + +@@ -109,13 +106,15 @@ + * long as we know how many we managed to create and should expect. */ + for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) { + ct[i].ct_cvp = &cv; +- ct[i].ct_id = i; + ct[i].ct_name = SPLAT_CONDVAR_TEST1_NAME; + ct[i].ct_rc = 0; ++ ct[i].ct_thread = kthread_create(splat_condvar_test12_thread, ++ &ct[i], "%s/%d", SPLAT_CONDVAR_TEST_NAME, i); + +- pids[i] = kernel_thread(splat_condvar_test12_thread, &ct[i], 0); +- if (pids[i] >= 0) ++ if (!IS_ERR(ct[i].ct_thread)) { ++ wake_up_process(ct[i].ct_thread); + count++; ++ } + } + + /* Wait until all threads are waiting on the condition variable */ +@@ -160,7 +159,6 @@ + splat_condvar_test2(struct file *file, void *arg) + { + int i, count = 0, rc = 0; +- long pids[SPLAT_CONDVAR_TEST_COUNT]; + condvar_thr_t ct[SPLAT_CONDVAR_TEST_COUNT]; + condvar_priv_t cv; + +@@ -173,13 +171,15 @@ + * long as we know how many we managed to create and should expect. */ + for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) { + ct[i].ct_cvp = &cv; +- ct[i].ct_id = i; + ct[i].ct_name = SPLAT_CONDVAR_TEST2_NAME; + ct[i].ct_rc = 0; ++ ct[i].ct_thread = kthread_create(splat_condvar_test12_thread, ++ &ct[i], "%s/%d", SPLAT_CONDVAR_TEST_NAME, i); + +- pids[i] = kernel_thread(splat_condvar_test12_thread, &ct[i], 0); +- if (pids[i] > 0) ++ if (!IS_ERR(ct[i].ct_thread)) { ++ wake_up_process(ct[i].ct_thread); + count++; ++ } + } + + /* Wait until all threads are waiting on the condition variable */ +@@ -208,17 +208,14 @@ + { + condvar_thr_t *ct = (condvar_thr_t *)arg; + condvar_priv_t *cv = ct->ct_cvp; +- char name[16]; + clock_t rc; + + ASSERT(cv->cv_magic == SPLAT_CONDVAR_TEST_MAGIC); +- snprintf(name, sizeof(name), "%s%d", SPLAT_CONDVAR_TEST_NAME, ct->ct_id); +- daemonize(name); + + mutex_enter(&cv->cv_mtx); + splat_vprint(cv->cv_file, ct->ct_name, +- "%s thread sleeping with %d waiters\n", +- name, atomic_read(&cv->cv_condvar.cv_waiters)); ++ "%s thread sleeping with %d waiters\n", ++ ct->ct_thread->comm, atomic_read(&cv->cv_condvar.cv_waiters)); + + /* Sleep no longer than 3 seconds, for this test we should + * actually never sleep that long without being woken up. */ +@@ -226,11 +223,12 @@ + if (rc == -1) { + ct->ct_rc = -ETIMEDOUT; + splat_vprint(cv->cv_file, ct->ct_name, "%s thread timed out, " +- "should have been woken\n", name); ++ "should have been woken\n", ct->ct_thread->comm); + } else { + splat_vprint(cv->cv_file, ct->ct_name, +- "%s thread woken %d waiters remain\n", +- name, atomic_read(&cv->cv_condvar.cv_waiters)); ++ "%s thread woken %d waiters remain\n", ++ ct->ct_thread->comm, ++ atomic_read(&cv->cv_condvar.cv_waiters)); + } + + mutex_exit(&cv->cv_mtx); +@@ -242,7 +240,6 @@ + splat_condvar_test3(struct file *file, void *arg) + { + int i, count = 0, rc = 0; +- long pids[SPLAT_CONDVAR_TEST_COUNT]; + condvar_thr_t ct[SPLAT_CONDVAR_TEST_COUNT]; + condvar_priv_t cv; + +@@ -255,13 +252,15 @@ + * long as we know how many we managed to create and should expect. */ + for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) { + ct[i].ct_cvp = &cv; +- ct[i].ct_id = i; + ct[i].ct_name = SPLAT_CONDVAR_TEST3_NAME; + ct[i].ct_rc = 0; ++ ct[i].ct_thread = kthread_create(splat_condvar_test34_thread, ++ &ct[i], "%s/%d", SPLAT_CONDVAR_TEST_NAME, i); + +- pids[i] = kernel_thread(splat_condvar_test34_thread, &ct[i], 0); +- if (pids[i] >= 0) ++ if (!IS_ERR(ct[i].ct_thread)) { ++ wake_up_process(ct[i].ct_thread); + count++; ++ } + } + + /* Wait until all threads are waiting on the condition variable */ +@@ -311,7 +310,6 @@ + splat_condvar_test4(struct file *file, void *arg) + { + int i, count = 0, rc = 0; +- long pids[SPLAT_CONDVAR_TEST_COUNT]; + condvar_thr_t ct[SPLAT_CONDVAR_TEST_COUNT]; + condvar_priv_t cv; + +@@ -324,13 +322,15 @@ + * long as we know how many we managed to create and should expect. */ + for (i = 0; i < SPLAT_CONDVAR_TEST_COUNT; i++) { + ct[i].ct_cvp = &cv; +- ct[i].ct_id = i; + ct[i].ct_name = SPLAT_CONDVAR_TEST3_NAME; + ct[i].ct_rc = 0; ++ ct[i].ct_thread = kthread_create(splat_condvar_test34_thread, ++ &ct[i], "%s/%d", SPLAT_CONDVAR_TEST_NAME, i); + +- pids[i] = kernel_thread(splat_condvar_test34_thread, &ct[i], 0); +- if (pids[i] >= 0) ++ if (!IS_ERR(ct[i].ct_thread)) { ++ wake_up_process(ct[i].ct_thread); + count++; ++ } + } + + /* Wait until all threads are waiting on the condition variable */ +diff --git a/module/splat/splat-rwlock.c b/module/splat/splat-rwlock.c +index 9e335d7..f4a0109 100644 +--- a/module/splat/splat-rwlock.c ++++ b/module/splat/splat-rwlock.c +@@ -82,7 +82,7 @@ + typedef struct rw_thr { + const char *rwt_name; + rw_priv_t *rwt_rwp; +- int rwt_id; ++ struct task_struct *rwt_thread; + } rw_thr_t; + + void splat_init_rw_priv(rw_priv_t *rwp, struct file *file) +@@ -106,17 +106,15 @@ void splat_init_rw_priv(rw_priv_t *rwp, struct file *file) + rw_thr_t *rwt = (rw_thr_t *)arg; + rw_priv_t *rwp = rwt->rwt_rwp; + uint8_t rnd; +- char name[16]; + + ASSERT(rwp->rw_magic == SPLAT_RWLOCK_TEST_MAGIC); +- snprintf(name, sizeof(name), "rwlock_wr_thr%d", rwt->rwt_id); +- daemonize(name); ++ + get_random_bytes((void *)&rnd, 1); + msleep((unsigned int)rnd); + + splat_vprint(rwp->rw_file, rwt->rwt_name, +- "%s trying to acquire rwlock (%d holding/%d waiting)\n", +- name, rwp->rw_holders, rwp->rw_waiters); ++ "%s trying to acquire rwlock (%d holding/%d waiting)\n", ++ rwt->rwt_thread->comm, rwp->rw_holders, rwp->rw_waiters); + spin_lock(&rwp->rw_lock); + rwp->rw_waiters++; + spin_unlock(&rwp->rw_lock); +@@ -127,20 +125,20 @@ void splat_init_rw_priv(rw_priv_t *rwp, struct file *file) + rwp->rw_holders++; + spin_unlock(&rwp->rw_lock); + splat_vprint(rwp->rw_file, rwt->rwt_name, +- "%s acquired rwlock (%d holding/%d waiting)\n", +- name, rwp->rw_holders, rwp->rw_waiters); ++ "%s acquired rwlock (%d holding/%d waiting)\n", ++ rwt->rwt_thread->comm, rwp->rw_holders, rwp->rw_waiters); + + /* Wait for control thread to signal we can release the write lock */ + wait_event_interruptible(rwp->rw_waitq, splat_locked_test(&rwp->rw_lock, +- rwp->rw_release == SPLAT_RWLOCK_RELEASE_WR)); ++ rwp->rw_release == SPLAT_RWLOCK_RELEASE_WR)); + + spin_lock(&rwp->rw_lock); + rwp->rw_completed++; + rwp->rw_holders--; + spin_unlock(&rwp->rw_lock); + splat_vprint(rwp->rw_file, rwt->rwt_name, +- "%s dropped rwlock (%d holding/%d waiting)\n", +- name, rwp->rw_holders, rwp->rw_waiters); ++ "%s dropped rwlock (%d holding/%d waiting)\n", ++ rwt->rwt_thread->comm, rwp->rw_holders, rwp->rw_waiters); + + rw_exit(&rwp->rw_rwlock); + +@@ -153,21 +151,19 @@ void splat_init_rw_priv(rw_priv_t *rwp, struct file *file) + rw_thr_t *rwt = (rw_thr_t *)arg; + rw_priv_t *rwp = rwt->rwt_rwp; + uint8_t rnd; +- char name[16]; + + ASSERT(rwp->rw_magic == SPLAT_RWLOCK_TEST_MAGIC); +- snprintf(name, sizeof(name), "rwlock_rd_thr%d", rwt->rwt_id); +- daemonize(name); ++ + get_random_bytes((void *)&rnd, 1); + msleep((unsigned int)rnd); + + /* Don't try and take the semaphore until after someone has it */ +- wait_event_interruptible(rwp->rw_waitq, splat_locked_test(&rwp->rw_lock, +- rwp->rw_holders > 0)); ++ wait_event_interruptible(rwp->rw_waitq, ++ splat_locked_test(&rwp->rw_lock, rwp->rw_holders > 0)); + + splat_vprint(rwp->rw_file, rwt->rwt_name, +- "%s trying to acquire rwlock (%d holding/%d waiting)\n", +- name, rwp->rw_holders, rwp->rw_waiters); ++ "%s trying to acquire rwlock (%d holding/%d waiting)\n", ++ rwt->rwt_thread->comm, rwp->rw_holders, rwp->rw_waiters); + spin_lock(&rwp->rw_lock); + rwp->rw_waiters++; + spin_unlock(&rwp->rw_lock); +@@ -178,20 +174,20 @@ void splat_init_rw_priv(rw_priv_t *rwp, struct file *file) + rwp->rw_holders++; + spin_unlock(&rwp->rw_lock); + splat_vprint(rwp->rw_file, rwt->rwt_name, +- "%s acquired rwlock (%d holding/%d waiting)\n", +- name, rwp->rw_holders, rwp->rw_waiters); ++ "%s acquired rwlock (%d holding/%d waiting)\n", ++ rwt->rwt_thread->comm, rwp->rw_holders, rwp->rw_waiters); + + /* Wait for control thread to signal we can release the read lock */ + wait_event_interruptible(rwp->rw_waitq, splat_locked_test(&rwp->rw_lock, +- rwp->rw_release == SPLAT_RWLOCK_RELEASE_RD)); ++ rwp->rw_release == SPLAT_RWLOCK_RELEASE_RD)); + + spin_lock(&rwp->rw_lock); + rwp->rw_completed++; + rwp->rw_holders--; + spin_unlock(&rwp->rw_lock); + splat_vprint(rwp->rw_file, rwt->rwt_name, +- "%s dropped rwlock (%d holding/%d waiting)\n", +- name, rwp->rw_holders, rwp->rw_waiters); ++ "%s dropped rwlock (%d holding/%d waiting)\n", ++ rwt->rwt_thread->comm, rwp->rw_holders, rwp->rw_waiters); + + rw_exit(&rwp->rw_rwlock); + +@@ -202,7 +198,6 @@ void splat_init_rw_priv(rw_priv_t *rwp, struct file *file) + splat_rwlock_test1(struct file *file, void *arg) + { + int i, count = 0, rc = 0; +- long pids[SPLAT_RWLOCK_TEST_COUNT]; + rw_thr_t rwt[SPLAT_RWLOCK_TEST_COUNT]; + rw_priv_t *rwp; + +@@ -214,22 +209,22 @@ void splat_init_rw_priv(rw_priv_t *rwp, struct file *file) + + /* Create some threads, the exact number isn't important just as + * long as we know how many we managed to create and should expect. */ +- +- +- + for (i = 0; i < SPLAT_RWLOCK_TEST_COUNT; i++) { + rwt[i].rwt_rwp = rwp; +- rwt[i].rwt_id = i; + rwt[i].rwt_name = SPLAT_RWLOCK_TEST1_NAME; + + /* The first thread will be the writer */ + if (i == 0) +- pids[i] = kernel_thread(splat_rwlock_wr_thr, &rwt[i], 0); ++ rwt[i].rwt_thread = kthread_create(splat_rwlock_wr_thr, ++ &rwt[i], "%s/%d", SPLAT_RWLOCK_TEST_NAME, i); + else +- pids[i] = kernel_thread(splat_rwlock_rd_thr, &rwt[i], 0); ++ rwt[i].rwt_thread = kthread_create(splat_rwlock_rd_thr, ++ &rwt[i], "%s/%d", SPLAT_RWLOCK_TEST_NAME, i); + +- if (pids[i] >= 0) ++ if (!IS_ERR(rwt[i].rwt_thread)) { ++ wake_up_process(rwt[i].rwt_thread); + count++; ++ } + } + + /* Wait for the writer */ +-- +1.7.10 + diff --git a/sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild b/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild index af7a82750022..42e41a9c3466 100644 --- a/sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild +++ b/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc11-r1.ebuild,v 1.1 2012/10/17 04:57:33 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc11-r2.ebuild,v 1.1 2012/12/11 19:42:28 ryao Exp $ EAPI="4" AUTOTOOLS_AUTORECONF="1" @@ -56,6 +56,7 @@ src_prepare() { # Linux 3.6 Support epatch "${FILESDIR}/${P}-linux-3.6-compat.patch" + epatch "${FILESDIR}/${PN}-0.6.0_rc12-fix-3.6-compat-regression.patch" autotools-utils_src_prepare } diff --git a/sys-kernel/spl/spl-0.6.0_rc12-r1.ebuild b/sys-kernel/spl/spl-0.6.0_rc12-r1.ebuild new file mode 100644 index 000000000000..979fad83182e --- /dev/null +++ b/sys-kernel/spl/spl-0.6.0_rc12-r1.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/spl/spl-0.6.0_rc12-r1.ebuild,v 1.1 2012/12/11 19:42:28 ryao Exp $ + +EAPI="4" +AUTOTOOLS_AUTORECONF="1" + +inherit flag-o-matic linux-mod autotools-utils + +if [[ ${PV} == "9999" ]] ; then + inherit git-2 + EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git" +else + inherit eutils versionator + MY_PV=$(replace_version_separator 3 '-') + SRC_URI="https://github.com/downloads/zfsonlinux/${PN}/${PN}-${MY_PV}.tar.gz" + S="${WORKDIR}/${PN}-${MY_PV}" + KEYWORDS="~amd64" +fi + +DESCRIPTION="The Solaris Porting Layer is a Linux kernel module which provides many of the Solaris kernel APIs" +HOMEPAGE="http://zfsonlinux.org/" + +LICENSE="|| ( GPL-2 GPL-3 )" +SLOT="0" +IUSE="custom-cflags debug" +RESTRICT="test" + +RDEPEND="!sys-devel/spl" + +AT_M4DIR="config" +AUTOTOOLS_IN_SOURCE_BUILD="1" + +pkg_setup() { + CONFIG_CHECK=" + !DEBUG_LOCK_ALLOC + !GRKERNSEC_HIDESYM + MODULES + KALLSYMS + !PAX_KERNEXEC_PLUGIN_METHOD_OR + ZLIB_DEFLATE + ZLIB_INFLATE + " + + kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required" + + [ ${PV} != "9999" ] && \ + { kernel_is le 3 7 || die "Linux 3.7 is the latest supported version."; } + + check_extra_config +} + +src_prepare() { + # Workaround for hard coded path + sed -i "s|/sbin/lsmod|/bin/lsmod|" scripts/check.sh || die + + # Stability Fix + epatch "${FILESDIR}/${P}-fix-race-in-slabs.patch" + + # Linux 3.6 Support + epatch "${FILESDIR}/${P}-fix-3.6-compat-regression.patch" + + # Linux 3.7 Support + epatch "${FILESDIR}/${P}-linux-3.7-compat.patch" + + autotools-utils_src_prepare +} + +src_configure() { + use custom-cflags || strip-flags + set_arch_to_kernel + local myeconfargs=( + --bindir="${EPREFIX}/bin" + --sbindir="${EPREFIX}/sbin" + --with-config=all + --with-linux="${KV_DIR}" + --with-linux-obj="${KV_OUT_DIR}" + $(use_enable debug) + ) + autotools-utils_src_configure +} + +src_test() { + if [[ ! -e /proc/modules ]] + then + die "Missing /proc/modules" + elif [[ $UID -ne 0 ]] + then + ewarn "Cannot run make check tests with FEATURES=userpriv." + ewarn "Skipping make check tests." + elif grep -q '^spl ' /proc/modules + then + ewarn "Cannot run make check tests with module spl loaded." + ewarn "Skipping make check tests." + else + autotools-utils_src_test + fi +} |