Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757670AbYGILuV (ORCPT ); Wed, 9 Jul 2008 07:50:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753813AbYGILuG (ORCPT ); Wed, 9 Jul 2008 07:50:06 -0400 Received: from ipmail01.adl6.internode.on.net ([203.16.214.146]:61019 "EHLO ipmail01.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354AbYGILuE (ORCPT ); Wed, 9 Jul 2008 07:50:04 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMdCdEh5LFxA/2dsb2JhbACwCw X-IronPort-AV: E=Sophos;i="4.30,331,1212330600"; d="scan'208";a="145222754" Date: Wed, 9 Jul 2008 21:49:58 +1000 From: Dave Chinner To: Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709114958.GV11558@disturbed> Mail-Followup-To: Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080709110900.GI9957@mit.edu> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2198 Lines: 56 On Wed, Jul 09, 2008 at 07:09:00AM -0400, Theodore Tso wrote: > > > > Bloody hell! Doesn't *anyone* understand that a frozen filesystem is > > *clean*? That the process of freezing it ensures all dirty data and > > metadata is written out before the freeze completes? And that once > > frozen, it can't be dirtied until unfrozen? > > What do you mean by "it can't be diritied until unfrozen". What > happens if I have a kernel compilation happening on a filesystem which > I am trying to freeze? Does > (a) the freeze fail (because the checks equivalent to what happens > when you remount a filesystem read-only happen)? > > (b) The process gets a kill -9 when it tries to write a file on the > frozen filesystem? > > (c) The process gets a kill -STOP when it tries to write > to a file on the frozen filesystem? > > (d) The process won't fail, but just continue to run, filling the page > cache with dirty pages that can't be written out because the > filesystem is frozen? (e) none of the above. The kernel compilation will appear to pause until the filesystem is unfrozen. No other visible effect should occur. It will get blocked in a write or filesystem transaction because the fs is frozen. Look at vfs_check_frozen() - any call to that will block if the filesystem is frozen or being frozen. The generic hook is in __generic_file_aio_write_nolock() and various other filesystems have calls in their specific write paths (fuse, ntfs, ocfs2, xfs, xip) to do this. For all other modifications, filesystem specific methods of blocking transactions are used. XFS uses vfs_check_frozen() in xfs_trans_alloc(), ext3 (and probably ocfs2) do it via their ->write_super_lockfs method calling journal_lock_updates(), ext4 via jbd2_lock_updates() and so on.... When the filesystem is unfrozen the journal is unlocked and anything sleeping on the vfs_check_frozen() waitqueue is woken..... Cheers, Dave. -- Dave Chinner david@fromorbit.com -- 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/