From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936490AbcISH7R (ORCPT ); Mon, 19 Sep 2016 03:59:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:33702 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936366AbcISH7B (ORCPT ); Mon, 19 Sep 2016 03:59:01 -0400 Date: Mon, 19 Sep 2016 09:58:58 +0200 From: Jan Kara To: Thomas Gleixner Cc: LKML , Jan Kara , "Theodore Ts'o" , Sebastian Sewior Subject: Re: [BUG] jbd2: lockdep deadlock warning Message-ID: <20160919075858.GA11487@quack2.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Fri 16-09-16 15:35:39, Thomas Gleixner wrote: > Jan, > > wer are currently moving the RT patch to 4.8 and on our test runs we > triggered the following lockdep splat: > > [ 153.887910] ====================================================== > [ 153.887911] [ INFO: possible circular locking dependency detected ] > [ 153.887912] 4.8.0-rc6-rt0+ #679 Tainted: G W > [ 153.887912] ------------------------------------------------------- > [ 153.887913] find/2537 is trying to acquire lock: > [ 153.887923] (&journal->j_state_lock){+.+...}, at: [] jbd2_log_start_commit+0x20/0x40 > [ 153.887924] > [ 153.887924] but task is already holding lock: > [ 153.887925] (jbd2_handle){++++..}, at: [] start_this_handle+0x111/0x470 > [ 153.887925] > [ 153.887925] which lock already depends on the new lock. > [ 153.887925] > [ 153.887926] > [ 153.887926] the existing dependency chain (in reverse order) is: > [ 153.887927] > [ 153.887927] -> #1 (jbd2_handle){++++..}: > [ 153.887931] [] lock_acquire+0x12f/0x2c0 > [ 153.887932] [] add_transaction_credits+0x4d/0x310 > [ 153.887933] [] start_this_handle+0x109/0x470 > [ 153.887933] [] jbd2__journal_start+0xdb/0x380 > [ 153.887936] [] __ext4_journal_start_sb+0x90/0x2b0 > [ 153.887940] [] ext4_file_open+0x11e/0x230 > [ 153.887946] [] do_dentry_open.isra.16+0x168/0x310 > [ 153.887948] [] vfs_open+0x45/0x70 > [ 153.887950] [] path_openat+0x48c/0xa20 > [ 153.887951] [] do_filp_open+0x7e/0xe0 > [ 153.887953] [] do_open_execat+0x64/0x150 > [ 153.887954] [] do_execveat_common.isra.43+0x278/0x950 > [ 153.887955] [] compat_SyS_execve+0x40/0x50 > [ 153.887956] [] do_fast_syscall_32+0xb2/0x2f0 > [ 153.887960] [] entry_SYSENTER_compat+0x51/0x60 Thanks for report! This is a bug in lockdep annotation in add_transaction_credits() where I mistakenly added a call to jbd2_might_wait_for_commit() before actually releasing the j_state_lock. I'll send a fix. I'm surprised this didn't hit in my testing... Honza -- Jan Kara SUSE Labs, CR