From: Andreas Dilger Subject: Re: 3.11.4: kernel BUG at fs/buffer.c:1268 Date: Thu, 31 Oct 2013 12:33:42 -0600 Message-ID: References: <20131009172336.GH13318@ZenIV.linux.org.uk> <20131017211143.1712.qmail@science.horizon.com> <20131017221450.GU13318@ZenIV.linux.org.uk> Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jan Kara , Al Viro , "linux-fsdevel@vger.kernel.org Devel" , Linux Kernel Mailing List To: George Spelvin Return-path: Received: from mail-pa0-f41.google.com ([209.85.220.41]:42547 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753463Ab3JaSdp convert rfc822-to-8bit (ORCPT ); Thu, 31 Oct 2013 14:33:45 -0400 Received: by mail-pa0-f41.google.com with SMTP id rd3so2911483pab.14 for ; Thu, 31 Oct 2013 11:33:44 -0700 (PDT) In-Reply-To: <20131017221450.GU13318@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Oct 17, 2013, at 4:14 PM, Al Viro wrote: > On Thu, Oct 17, 2013 at 05:11:43PM -0400, George Spelvin wrote: >>=20 >> Well, it happened again (error appended). Can you please clarify wh= at you mean >> by "such BUG_ON()"; I'm having a hard time following the RCU code an= d determining >> all the situations under which __fput() might be called. >=20 > __fput() can be called via task_work_run() or via schedule_work(). T= hat's > all. And it certainly should never be called with interrupts disable= d. > So stick BUG_ON(irqs_disabled()) in it (WARN_ON() might be better, bu= t > not by much). >=20 > There are two ways these traces could've happened: > * exit_task_work() called by do_exit() with irqs disabled. > Definitely buggy (and would do really nasty things to several functio= ns > called by do_exit() before that one).=20 > * __fput() is called with irqs enabled, but somewhere on the > way into ext4 (dput -> iput -> evict inode -> free blocks, now that > unlinked file got closed -> ...) we manage to disable irqs and forget > to enable them. IMHO the most common case of "BUG: sleeping function called from invalid context=94 is due to stack overflow. This corrupts the task struct, and incorrectly sets the =93in_interrupt=94 bit. What kind of storage stack is underneath this filesystem? If it is deep (e.g. DM + LVM + iSCSI) then the stack overflow is definitely possible. There were also a discussion by Christoph of page allocation recursing into the fs again (in "xfs: prevent stack overflows from page cache allocation=94) though I=92m not sure if that applies to ext4 or not. Cheers, Andreas -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html