From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH] remove BUG() in possible but rare condition Date: Wed, 11 Apr 2012 16:02:19 -0300 Message-ID: <4F85D53B.1070806@parallels.com> References: <1334167824-19142-1-git-send-email-glommer@parallels.com> <20120411184845.GA24831@tiehlicka.suse.cz> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Linus Torvalds Cc: Michal Hocko , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Johannes Weiner , kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, Greg Thelen , Suleiman Souhlal , Andrew Morton On 04/11/2012 03:57 PM, Linus Torvalds wrote: > On Wed, Apr 11, 2012 at 11:48 AM, Michal Hocko wrote: >> >> I am not familiar with the code much but a trivial call chain walk up to >> write_dev_supers (in btrfs) shows that we do not check for the return value >> from __getblk so we would nullptr and there might be more. >> I guess these need some treat before the BUG might be removed, right? > > Well, realistically, isn't BUG() as bad as a NULL pointer dereference? > > Do you care about the exact message on the screen when your machine dies? Not particular, but I don't see why (I might be wrong) it would necessarily lead to a NULL pointer dereference. At least in my test cases, after turning this to a WARN (to make sure it was still being hit), the machine could go on just fine. I was running this in a container system, with restricted memory. After killing the container - at least in my ext4 system - everything seemed as happy as ever.