From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by kanga.kvack.org (Postfix) with ESMTP id 781F16B0032 for ; Tue, 17 Sep 2013 18:53:27 -0400 (EDT) Received: by mail-pd0-f173.google.com with SMTP id p10so6204714pdj.4 for ; Tue, 17 Sep 2013 15:53:27 -0700 (PDT) Received: by mail-pa0-f49.google.com with SMTP id ld10so7380373pab.8 for ; Tue, 17 Sep 2013 15:53:24 -0700 (PDT) Date: Tue, 17 Sep 2013 15:53:23 -0700 (PDT) From: David Rientjes Subject: Re: [PATCH v2] mm/shmem.c: check the return value of mpol_to_str() In-Reply-To: <5237ABF3.4010109@asianux.com> Message-ID: References: <5215639D.1080202@asianux.com> <5227CF48.5080700@asianux.com> <522E6C14.7060006@asianux.com> <522EC3D1.4010806@asianux.com> <52312EC1.8080300@asianux.com> <523205A0.1000102@gmail.com> <5232773E.8090007@asianux.com> <5233424A.2050704@gmail.com> <5236732C.5060804@asianux.com> <52372EEF.7050608@gmail.com> <5237ABF3.4010109@asianux.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Chen Gang Cc: KOSAKI Motohiro , KOSAKI Motohiro , riel@redhat.com, hughd@google.com, xemul@parallels.com, Wanpeng Li , Cyrill Gorcunov , linux-mm@kvack.org, Andrew Morton On Tue, 17 Sep 2013, Chen Gang wrote: > > BUG_ON() is safe. but I still don't like it. As far as I heard, Google > > changes BUG_ON as nop. So, BUG_ON(mpol_to_str() < 0) breaks google. > > Please treat an assertion as assertion. Not any other something. > > Google does not disable BUG_ON(), sheesh. > Hmm... in kernel wide, BUG_ON() is 'common' 'standard' assertion, and > "mm/" is a common sub-system (not architecture specific), so when we > use BUG_ON(), we already 'express' our 'opinion' enough to readers. > That's ridiculous, we're not going to panic the kernel at runtime because a buffer is too small. Make it a compile-time error like I suggested so we catch this before we even build the kernel. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org