From: Bernd Schubert Subject: should bdi_init() initialize congested_fn? Date: Thu, 13 Oct 2011 17:12:29 +0200 Message-ID: <4E96FFDD.5030905@itwm.fraunhofer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Wu Fengguang To: "linux-fsdevel@vger.kernel.org" Return-path: Received: from mailgw1.uni-kl.de ([131.246.120.220]:37156 "EHLO mailgw1.uni-kl.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751833Ab1JMPMi (ORCPT ); Thu, 13 Oct 2011 11:12:38 -0400 Received: from itwm2.itwm.fhg.de (itwm2.itwm.fhg.de [131.246.191.3]) by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p9DFCahE028696 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Thu, 13 Oct 2011 17:12:36 +0200 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello, while testing FhGFS I got a stack trace that seems to point out that bdi_congested() tries to call an uninitialized bdi->congested_fn(). So I checked where ->congested_fn() is initialized - with exception of btrfs I do not find a file system that does that at all. But then bdi_init(), which is called by most file systems for initialization also does *not* initialize it. So either I'm missing something, or almost all bdi users have a bug? Thanks, Bernd > [ 351.110903] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC [...] > [ 351.112022] Call Trace: > [ 351.112022] [] ? _raw_spin_lock_irq+0x1d/0x60 > [ 351.112022] [] ? _raw_spin_unlock_irq+0x30/0x50 > [ 351.112022] [] shrink_inactive_list+0x193/0x430 > [ 351.112022] [] ? determine_dirtyable_memory+0x1a/0x30 > [ 351.112022] [] shrink_zone+0x46e/0x5e0 > [ 351.112022] [] try_to_free_pages+0x1b9/0x560 > [ 351.112022] [] ? __slab_alloc+0x405/0x5c0 > [ 351.112022] [] __alloc_pages_nodemask+0x4af/0x860 > [ 351.112022] [] ? __kmalloc_node+0x145/0x210 > [ 351.112022] [] alloc_pages_current+0x83/0x100 > [ 351.112022] [] __vmalloc_node_range+0x16a/0x210 [...] > [ 351.112022] RIP [] shrink_page_list+0x47f/0x960 > (gdb) l *(shrink_page_list+0x47f) > 0xffffffff8111247f is in shrink_page_list (include/linux/backing-dev.h:266). > 261 int writeback_in_progress(struct backing_dev_info *bdi); > 262 > 263 static inline int bdi_congested(struct backing_dev_info *bdi, int bdi_bits) > 264 { > 265 if (bdi->congested_fn) > 266 return bdi->congested_fn(bdi->congested_data, bdi_bits); > 267 return (bdi->state & bdi_bits); > 268 } > 269