Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbaAQOdE (ORCPT ); Fri, 17 Jan 2014 09:33:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37829 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974AbaAQOdC (ORCPT ); Fri, 17 Jan 2014 09:33:02 -0500 Date: Fri, 17 Jan 2014 06:33:29 -0800 From: Greg Kroah-Hartman To: Marek Szyprowski Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Andreas Dilger , Peng Tao Subject: Re: [PATCH] staging: lustre: fix GFP_ATOMIC macro usage Message-ID: <20140117143329.GA6877@kroah.com> References: <1389948416-26390-1-git-send-email-m.szyprowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1389948416-26390-1-git-send-email-m.szyprowski@samsung.com> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2014 at 09:46:56AM +0100, Marek Szyprowski wrote: > 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 > --- > .../lustre/include/linux/libcfs/libcfs_private.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > index d0d942c..dddccca1 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > @@ -120,7 +120,7 @@ do { \ > do { \ > LASSERT(!in_interrupt() || \ > ((size) <= LIBCFS_VMALLOC_SIZE && \ > - ((mask) & GFP_ATOMIC)) != 0); \ > + ((mask) & __GFP_WAIT) == 0)); \ > } while (0) What a horrible assert, can't we just remove this entirely? in_interrupt() usually should never be checked, if so, the code is doing something wrong. And __GFP flags shouldn't be used on their own. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/