linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: Erik Mouw <erik@harddisk-recovery.com>
Cc: Andreas Dilger <adilger@clusterfs.com>,
	UZAIR LAKHANI <uzairr_bs1b@yahoo.com>,
	linux-fsdevel@vger.kernel.org, Stephen Tweedie <sct@redhat.com>
Subject: Re: How To Recover Files From ext3 Partition??
Date: Mon, 08 May 2006 13:42:19 +0100	[thread overview]
Message-ID: <1147092139.5331.9.camel@sisko.sctweedie.blueyonder.co.uk> (raw)
In-Reply-To: <20060508123408.GE1875@harddisk-recovery.com>

Hi,

On Mon, 2006-05-08 at 14:34 +0200, Erik Mouw wrote:

> > Trouble is, there's no guarantee that that transaction would actually
> > fit into the journal.  Most of the time it will, but if it doesn't, then
> > we deadlock or risk data corruption.  
> 
> Is there some way to determine in advance if a transaction fits into
> the journal?

For truncate/delete, no, not easily.  Or rather, it's possible, but only
for trivially short files.  The trouble is that we can't assume that all
of the file's blocks are on the same block groups, so each block in the
file is potentially an update to a new group descriptor and a new block
bitmap (ie. 2 blocks of journal per block of file.)

That's hugely pessimistic, of course, but it is the genuine worst-case
scenario and we have to be prepared for it.  We only work out that we
need less once we actually start walking the file's indirect tree, at
which point the truncate is already under way.  

We _could_ walk the tree twice, but that would be unnecessarily
expensive, especially for large files.

--Stephen



  reply	other threads:[~2006-05-08 12:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-04 14:18 How To Recover Files From ext3 Partition?? UZAIR LAKHANI
2006-05-04 14:38 ` Erik Mouw
2006-05-05  5:16   ` UZAIR LAKHANI
2006-05-05 11:18     ` Erik Mouw
2006-05-05 16:41       ` Andreas Dilger
2006-05-08 10:51         ` Stephen C. Tweedie
2006-05-08 12:34           ` Erik Mouw
2006-05-08 12:42             ` Stephen C. Tweedie [this message]
2006-05-08 17:41               ` Andreas Dilger
2006-05-08 13:20           ` 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=1147092139.5331.9.camel@sisko.sctweedie.blueyonder.co.uk \
    --to=sct@redhat.com \
    --cc=adilger@clusterfs.com \
    --cc=erik@harddisk-recovery.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=uzairr_bs1b@yahoo.com \
    /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).