linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Andreas Dilger <adilger@sun.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH, RFC] jbd2: Add commit time into the commit block
Date: Sun, 16 Mar 2008 14:52:31 -0400	[thread overview]
Message-ID: <20080316185231.GL27847@mit.edu> (raw)
In-Reply-To: <20080316151617.GA3542@webber.adilger.int>

On Sun, Mar 16, 2008 at 11:16:17PM +0800, Andreas Dilger wrote:
> > I guess the third alternative, (c), is that we don't update *any* of
> > the superblock or block group descriptors until the very end of the
> > transaction, and don't update any of the blocks.  So we just update
> > the bitmap blocks first, and then in a second pass update all of the
> > blockgroup descriptors and superblock.  This would require assuring
> > that the update of all of the block group descriptors, superblock, and
> > removing the inode from the orphan linked list, can all fit in a
> > single transaction. If not, this scheme wouldn't work at all.
> 
> I'm not sure I understand this.  Wouldn't this possibly lead to those
> blocks being re-allocated after a crash?

No, because the inode is on the orphan/truncate list, which would get
processed as part of mounting the filesystem.  So we might end up
replaying some of the updates to the bitmaps, and clearing blocks that
are already cleared; but that's OK, because clearing the bitmap
allocations is an idempotent operation.  Incrementing the free blocks
count in the superblock and bitmap allocation blocks is *not*
idempotent, which means they they (along with removing the inode from
the orphaned inode list) all have to be done within a single atomic
transaction.

						- Ted

  reply	other threads:[~2008-03-16 18:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-16  0:59 [PATCH, RFC] jbd2: Add commit time into the commit block Theodore Ts'o
2008-03-16  1:23 ` Andreas Dilger
2008-03-16  1:26 ` Andreas Dilger
2008-03-16  3:10   ` Theodore Tso
2008-03-16 15:16     ` Andreas Dilger
2008-03-16 18:52       ` Theodore Tso [this message]
2008-03-25 18:57 ` Mingming Cao
2008-03-25 20:38   ` Theodore Tso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080316185231.GL27847@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).