From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790Ab1HAFEy (ORCPT ); Mon, 1 Aug 2011 01:04:54 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:55856 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752291Ab1HAFEq (ORCPT ); Mon, 1 Aug 2011 01:04:46 -0400 Date: Sun, 31 Jul 2011 22:04:35 -0700 From: Joel Becker To: Coly Li Cc: Andreas Dilger , "Darrick J. Wong" , Andreas Dilger , Mingming Cao , "Theodore Ts'o" , linux-ext4 , linux-kernel Subject: Re: [PATCH 0/2] Add inode checksum support to ext4 Message-ID: <20110801050435.GC5716@noexit.corp.google.com> Mail-Followup-To: Coly Li , Andreas Dilger , "Darrick J. Wong" , Andreas Dilger , Mingming Cao , Theodore Ts'o , linux-ext4 , linux-kernel References: <20110727082730.GG20655@tux1.beaverton.ibm.com> <20110728165615.GI20655@tux1.beaverton.ibm.com> <20110728220735.GA27253@noexit.corp.google.com> <0E795C1D-AD1E-4CC4-9426-2B58D98B14DC@dilger.ca> <20110729131937.GB5910@noexit.corp.google.com> <4E33B1EC.9030004@gmail.com> <20110731070832.GA2848@noexit.corp.google.com> <4E35EAC9.6070707@gmail.com> <20110801045710.GB5716@noexit.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110801045710.GB5716@noexit.corp.google.com> X-Burt-Line: Trees are cool. X-Red-Smith: Ninety feet between bases is perhaps as close as man has ever come to perfection. User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 31, 2011 at 09:57:11PM -0700, Joel Becker wrote: > On Mon, Aug 01, 2011 at 07:52:41AM +0800, Coly Li wrote: > > On 2011年07月31日 15:08, Joel Becker Wrote: > > > On Sat, Jul 30, 2011 at 03:25:32PM +0800, Coly Li wrote: > > >> And in non-journal mode, there is not copy of any meta data block in jbd2, we need to be > > >> more careful in check summing, e.g. inode/block bitmap blocks... > > > > > > Sure, but you could use a trigger in journaled mode and then do > > > the checksums directly in the __ext4_handle_journal_dirty_*() functions > > > in non-journaled mode. Sure, it would be a little more CPU time, but > > > the user picked "checksums + no journal" at mkfs time. > > > > > > > Yes, my idea was similar to you. > > One thing not clear to me is, in non-journal mode, how to make the page of bitmap block being stable. Because bits > > setting in Ext4 bitmap is non-locking, it might be possible that new bit setting after check sum is calculated. > > Every place that changes the bits will eventually call > ext4_journal_dirty(), which recalculates the checksum. So there's no > danger of a set-bit-after-last-checksum. But you will have to lock > around the checksum calculation in non-journaling mode. JBD2 handles it > for journaling mode. Wait, bitsetting in ext4 can't be non-locking. Or are they crazily stomping on memory? I sure see an assert_spin_locked() in mb_mark_used(). Joel -- "Well-timed silence hath more eloquence than speech." - Martin Fraquhar Tupper http://www.jlbec.org/ jlbec@evilplan.org