From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755975AbbCBVeS (ORCPT ); Mon, 2 Mar 2015 16:34:18 -0500 Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:28755 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753730AbbCBVeQ (ORCPT ); Mon, 2 Mar 2015 16:34:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DJIQCt1vRUPLeDLHlQCoMCgSyCO4N9qCUBAQEBAQEGjGKLYgICAQECgSROAQEBAQEBBQEBAQE4O4QQAQUnExwjEAgDDgoJJQ8FDRgDBxoTGYgCAxDSLw2FFgEBCAIBHxiFboUMgkSBTlwHhCsFl3eBR41QhguCIh+BZCoxgkMBAQE Date: Tue, 3 Mar 2015 08:33:39 +1100 From: Dave Chinner To: Mateusz Guzik Cc: Alexey Dobriyan , Jan Kara , Andrew Morton , Al Viro , Linux Kernel , linux-fsdevel , swhiteho@redhat.com, cluster-devel@redhat.com Subject: Re: [PATCH v3] fs: record task name which froze superblock Message-ID: <20150302213339.GI18360@dastard> References: <20150214185524.GA16579@p183.telecom.by> <20150216093852.GB4749@quack.suse.cz> <20150218073455.GA1752@p183.telecom.by> <20150218091323.GA4614@quack.suse.cz> <20150220121522.GC6293@quack.suse.cz> <20150228142235.GA19552@p183.telecom.by> <20150228142557.GB19552@p183.telecom.by> <20150228213126.GM4251@dastard> <20150302043828.GA2516@mguzik> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150302043828.GA2516@mguzik> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 02, 2015 at 05:38:29AM +0100, Mateusz Guzik wrote: > On Sun, Mar 01, 2015 at 08:31:26AM +1100, Dave Chinner wrote: > > On Sat, Feb 28, 2015 at 05:25:57PM +0300, Alexey Dobriyan wrote: > > > Freezing and thawing are separate system calls, task which is supposed > > > to thaw filesystem/superblock can disappear due to crash or not thaw > > > due to a bug. At least record task name (we can't take task_struct > > > reference) to make support engineer's life easier. > > > > > > Hopefully 16 bytes per superblock isn't much. > > > > > > TASK_COMM_LEN definition (which is userspace ABI, see prctl(PR_SET_NAME)) is > > > moved to userspace exported header to not drag sched.h into every fs.h inclusion. > > > > > > Signed-off-by: Alexey Dobriyan > > > > Freeze/thaw can be nested at the block level. That means the > > sb->s_writers.freeze_comm can point at the wrong process. i.e. > > > > Task A Task B > > freeze_bdev > > freeze_super > > freeze_comm = A > > freeze_bdev > > ..... > > thaw_bdev > > > > > > > > At this point, the block device will never be unthawed, but > > the debug field is now pointing to the wrong task. i.e. The debug > > helper has not recorded the process that is actually causing the > > problem, and leads us all off on a wild goose chase down the wrong > > path. > > > > IMO, debug code is only useful if it's reliable..... > > > > It can be trivially modified to be very useful to support people. > > Actually this patch clears saved task name on unfreeze, so in this > particular scenario we would end up with no data. It only clears it i thaw_super(), which is *not called* until the last nested thaw_bdev() call is made. When the system is hung what we actually need to know is who is responsible for *thawing* the filesystem and then we can work out why that hasn't run. What this code tries to do is identify who froze the filesystem and so indicate who *might* be responsible for thawing it. If we mis-identify the agent who holds the freeze status, then we fail to identify who needs to run the thaw and hence we're still stuck not knowing WTF happened.... I understand why you want to record this - I'm not arguing that we shouldn't do this. My point is that we should *make it reliable* and not in any way ambiguous, otherwise we failed to solve the problem it was intended for. Cheers, Dave. -- Dave Chinner david@fromorbit.com