]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Revert "Fix NULL deref in balance_pgdat()"
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 18 Aug 2012 18:05:53 +0000 (11:05 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 27 Aug 2012 19:00:55 +0000 (12:00 -0700)
This reverts commit b8b6e4c453929596b630fa1cca1ee26a532a2ab4.  The
use of the PF_MEMALLOC flag was always a hack to work around memory
reclaim deadlocks.  Those issues are believed to be resolved so this
workaround can be safely reverted.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/spl/spl-kmem.c

index 2d5f751b0610d7a5c5f5acb355a7d3e616694426..16eb4f884364e83597a61578c9aee9831bac9b95 100644 (file)
@@ -855,17 +855,14 @@ kv_alloc(spl_kmem_cache_t *skc, int size, int flags)
                 * been filed at kernel.org to track the issue.
                 *
                 * https://bugzilla.kernel.org/show_bug.cgi?id=30702
-                *
-                * NOTE: Only set PF_MEMALLOC if it's not already set, and
-                * then only clear it when we were the one who set it.
                 */
-               if (!(flags & __GFP_FS) && !(current->flags & PF_MEMALLOC)) {
+               if (!(flags & __GFP_FS))
                        current->flags |= PF_MEMALLOC;
-                       ptr = __vmalloc(size, flags|__GFP_HIGHMEM, PAGE_KERNEL);
+
+               ptr = __vmalloc(size, flags | __GFP_HIGHMEM, PAGE_KERNEL);
+
+               if (!(flags & __GFP_FS))
                        current->flags &= ~PF_MEMALLOC;
-               } else {
-                       ptr = __vmalloc(size, flags|__GFP_HIGHMEM, PAGE_KERNEL);
-               }
        }
 
        /* Resulting allocated memory will be page aligned */