Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755659AbbBPOBD (ORCPT ); Mon, 16 Feb 2015 09:01:03 -0500 Received: from mail-yh0-f49.google.com ([209.85.213.49]:51711 "EHLO mail-yh0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755256AbbBPOBA (ORCPT ); Mon, 16 Feb 2015 09:01:00 -0500 Date: Mon, 16 Feb 2015 09:00:54 -0500 From: Jeff Layton To: "Kirill A. Shutemov" Cc: Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "J. Bruce Fields" , Christoph Hellwig , Dave Chinner , Sasha Levin Subject: Re: [GIT PULL] please pull file-locking related changes for v3.20 Message-ID: <20150216090054.62455465@tlielax.poochiereds.net> In-Reply-To: <20150216133200.GB3270@node.dhcp.inet.fi> References: <20150209055540.2f2a3689@tlielax.poochiereds.net> <20150216133200.GB3270@node.dhcp.inet.fi> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4526 Lines: 90 On Mon, 16 Feb 2015 15:32:00 +0200 "Kirill A. Shutemov" wrote: > On Mon, Feb 09, 2015 at 05:55:40AM -0500, Jeff Layton wrote: > > The following changes since commit cb59670870d90ff8bc31f5f2efc407c6fe4938c0: > > > > Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse (2015-01-16 14:58:16 +1300) > > > > are available in the git repository at: > > > > git://git.samba.org/jlayton/linux.git tags/locks-v3.20-1 > > > > for you to fetch changes up to 8116bf4cb62d337c953cfa5369ef4cf83e73140c: > > > > locks: update comments that refer to inode->i_flock (2015-01-21 20:44:01 -0500) > > > > ---------------------------------------------------------------- > > File locking related changes for v3.20 (pile #1) > > > > This patchset contains a fairly major overhaul of how file locks are > > tracked within the inode. Rather than a single list, we now create a > > per-inode "lock context" that contains individual lists for the file > > locks, and a new dedicated spinlock for them. > > > > There are changes in other trees that are based on top of this set so > > it may be easiest to pull this in early. > > The warning below is triggered on exit from trinity by ctrl-c. I saw it > few times. > > [ 733.480323] ------------[ cut here ]------------ > [ 733.480985] WARNING: CPU: 1 PID: 24375 at /home/kas/git/public/linux-next/fs/locks.c:243 locks_free_lock_context+0x6a/0xd0() > [ 733.482393] Modules linked in: > [ 733.482807] CPU: 1 PID: 24375 Comm: trinity-main Not tainted 3.19.0-next-20150212-00024-g8d751e144a78-dirty #641 > [ 733.484108] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org 04/01/2014 > [ 733.485713] ffffffff81c9c150 ffff88084b88bc88 ffffffff81883d17 0000000000000007 > [ 733.486708] 0000000000000000 ffff88084b88bcc8 ffffffff81054eca ffff88007a31dc30 > [ 733.487701] ffff88007060fda0 ffff88007a31dc30 ffffffff81a27940 ffff88007a31dc30 > [ 733.488695] Call Trace: > [ 733.489017] [] dump_stack+0x4f/0x7b > [ 733.489678] [] warn_slowpath_common+0x8a/0xc0 > [ 733.490431] [] warn_slowpath_null+0x1a/0x20 > [ 733.491165] [] locks_free_lock_context+0x6a/0xd0 > [ 733.491959] [] __destroy_inode+0x32/0xe0 > [ 733.492715] [] destroy_inode+0x26/0x70 > [ 733.493394] [] evict+0x112/0x1a0 > [ 733.494026] [] iput+0x2be/0x3d0 > [ 733.494635] [] __dentry_kill+0x190/0x200 > [ 733.495341] [] dput+0x39b/0x3d0 > [ 733.495946] [] ? dput+0x29/0x3d0 > [ 733.496581] [] __fput+0x14c/0x220 > [ 733.497218] [] ____fput+0xe/0x10 > [ 733.497847] [] task_work_run+0xb4/0xe0 > [ 733.498532] [] do_exit+0x36e/0xd60 > [ 733.499175] [] ? retint_swapgs+0xe/0x44 > [ 733.499868] [] ? __this_cpu_preempt_check+0x13/0x20 > [ 733.500695] [] do_group_exit+0x54/0xe0 > [ 733.501388] [] SyS_exit_group+0x14/0x20 > [ 733.502080] [] system_call_fastpath+0x12/0x17 > [ 733.502874] ---[ end trace bcc1a9752062721f ]--- > Thanks Kirill. This looks similar to the problem that Sasha Levin reported when I had this in linux-next. Basically, we're tearing down the i_flctx when tearing down the inode, but the i_flock list isn't empty. Most likely what happened is that we had a flock lock race onto the inode around the same time that locks_remove_file was called for the file. Moving the setting of i_flctx under the i_lock seemed to resolve it before for Sasha, but I think that this shows that that's not 100% sufficient. So I suspect we have either a cache-coherency problem where the cpu running locks_remove_file doesn't realize that the i_flctx was recently set, or there's something wrong with the fget/fput machinery. Probably the former. I'll look at it again and also see if I can reproduce it with trinity. So far, I haven't been able to, but maybe I'll get lucky this time. Thanks, -- Jeff Layton -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/