]> Pileus Git - ~andy/linux/commitdiff
staging: lustre: fix GFP_ATOMIC macro usage
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 17 Jan 2014 08:46:56 +0000 (09:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 17:05:00 +0000 (09:05 -0800)
GFP_ATOMIC is not a single gfp flag, but a macro which expands to the other
flags and LACK of __GFP_WAIT flag. To check if caller wanted to perform an
atomic allocation, the code must test __GFP_WAIT flag presence.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_private.h

index d0d942ced01a57c804efdfa712fa62977678c911..dddccca120c90be3a5d4a366b1a55caabe873971 100644 (file)
@@ -120,7 +120,7 @@ do {                                                \
 do {                                                                       \
        LASSERT(!in_interrupt() ||                                          \
                ((size) <= LIBCFS_VMALLOC_SIZE &&                           \
-                ((mask) & GFP_ATOMIC)) != 0);                      \
+                ((mask) & __GFP_WAIT) == 0));                              \
 } while (0)
 
 #define LIBCFS_ALLOC_POST(ptr, size)                                       \