From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: [PATCH block/for-4.5-fixes] writeback: keep superblock pinned during cgroup writeback association switches Date: Tue, 16 Feb 2016 11:34:33 -0700 Message-ID: <56C36BB9.5000104@kernel.dk> References: <20160215210047.GN3965@htj.duckdns.org> <20160216182457.GO3741@mtj.duckdns.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=LG2G0AwMOS3ql6il0LBQNrNV5c854sx39VsQQsPT23E=; b=Q5atjd+2ew+KrkCY331Ten1C6AONeL23KXDCicjdt23Xc1Y/3XruChefJ7pYcDk91X aAest6rMedpFdgWq/6+JwkL3/bUdJJOQmO39fHxpUK+7shDMJo7ZR4Cf6rlQh5N1hUwk beBAF3r6Ldx053IPPMcqRitGCq+kyOTJGzHIlbkLrkq6G2Z4+wbWyeShM58EL8LljiHt mplbi0A6NtUmeWNb/srTdxHiA+bNUFJjo2zBY15KHiBVdY97ToiU8emngLigdRjvE1TR MrQ0WFxn7Wb8AfN/r3/HFsDjqGC4v/Uirx7W8ZvTu45sGZabLsa0dwFqWYxFRwhHCL1j Zzag== In-Reply-To: <20160216182457.GO3741-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Tejun Heo , Tahsin Erdogan Cc: cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Theodore Ts'o , Nauman Rafique , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jan Kara On 02/16/2016 11:24 AM, Tejun Heo wrote: > From 586afaa034bec88934bad4eb6ab38ba07031ec5a Mon Sep 17 00:00:00 2001 > From: Tejun Heo > Date: Tue, 16 Feb 2016 13:14:35 -0500 > > If cgroup writeback is in use, an inode is associated with a cgroup > for writeback. If the inode's main dirtier changes to another cgroup, > the association gets updated asynchronously. Nothing was pinning the > superblock while such switches are in progress and superblock could go > away while async switching is pending or in progress leading to > crashes like the following. > > kernel BUG at fs/jbd2/transaction.c:319! > invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC > CPU: 1 PID: 29158 Comm: kworker/1:10 Not tainted 4.5.0-rc3 #51 > Hardware name: Google Google, BIOS Google 01/01/2011 > Workqueue: events inode_switch_wbs_work_fn > task: ffff880213dbbd40 ti: ffff880209264000 task.ti: ffff880209264000 > RIP: 0010:[] [] start_this_handle+0x382/0x3e0 > RSP: 0018:ffff880209267c30 EFLAGS: 00010202 > ... > Call Trace: > [] jbd2__journal_start+0xf4/0x190 > [] __ext4_journal_start_sb+0x4e/0x70 > [] ext4_evict_inode+0x12c/0x3d0 > [] evict+0xbb/0x190 > [] iput+0x130/0x190 > [] inode_switch_wbs_work_fn+0x343/0x4c0 > [] process_one_work+0x129/0x300 > [] worker_thread+0x126/0x480 > [] kthread+0xc4/0xe0 > [] ret_from_fork+0x3f/0x70 > > Fix it by bumping s_active while cgroup association switching is in > flight. Added for 4.5. -- Jens Axboe From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755827AbcBPSej (ORCPT ); Tue, 16 Feb 2016 13:34:39 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34688 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753850AbcBPSeg (ORCPT ); Tue, 16 Feb 2016 13:34:36 -0500 Subject: Re: [PATCH block/for-4.5-fixes] writeback: keep superblock pinned during cgroup writeback association switches To: Tejun Heo , Tahsin Erdogan References: <20160215210047.GN3965@htj.duckdns.org> <20160216182457.GO3741@mtj.duckdns.org> Cc: cgroups@vger.kernel.org, "Theodore Ts'o" , Nauman Rafique , linux-kernel@vger.kernel.org, Jan Kara From: Jens Axboe Message-ID: <56C36BB9.5000104@kernel.dk> Date: Tue, 16 Feb 2016 11:34:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160216182457.GO3741@mtj.duckdns.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/16/2016 11:24 AM, Tejun Heo wrote: > From 586afaa034bec88934bad4eb6ab38ba07031ec5a Mon Sep 17 00:00:00 2001 > From: Tejun Heo > Date: Tue, 16 Feb 2016 13:14:35 -0500 > > If cgroup writeback is in use, an inode is associated with a cgroup > for writeback. If the inode's main dirtier changes to another cgroup, > the association gets updated asynchronously. Nothing was pinning the > superblock while such switches are in progress and superblock could go > away while async switching is pending or in progress leading to > crashes like the following. > > kernel BUG at fs/jbd2/transaction.c:319! > invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC > CPU: 1 PID: 29158 Comm: kworker/1:10 Not tainted 4.5.0-rc3 #51 > Hardware name: Google Google, BIOS Google 01/01/2011 > Workqueue: events inode_switch_wbs_work_fn > task: ffff880213dbbd40 ti: ffff880209264000 task.ti: ffff880209264000 > RIP: 0010:[] [] start_this_handle+0x382/0x3e0 > RSP: 0018:ffff880209267c30 EFLAGS: 00010202 > ... > Call Trace: > [] jbd2__journal_start+0xf4/0x190 > [] __ext4_journal_start_sb+0x4e/0x70 > [] ext4_evict_inode+0x12c/0x3d0 > [] evict+0xbb/0x190 > [] iput+0x130/0x190 > [] inode_switch_wbs_work_fn+0x343/0x4c0 > [] process_one_work+0x129/0x300 > [] worker_thread+0x126/0x480 > [] kthread+0xc4/0xe0 > [] ret_from_fork+0x3f/0x70 > > Fix it by bumping s_active while cgroup association switching is in > flight. Added for 4.5. -- Jens Axboe