All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <aedilger@gmail.com>
To: Yongqiang Yang <xiaoqiangnk@gmail.com>
Cc: Andreas Dilger <aedilger@gmail.com>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	"Ted Ts'o" <tytso@mit.edu>
Subject: Re: backup of the last group'descriptor when it is the 1st group of a meta_bg
Date: Sun, 1 Apr 2012 23:46:06 -0600	[thread overview]
Message-ID: <48603AD4-9120-41F1-A796-06684D605C57@dilger.ca> (raw)
In-Reply-To: <CAGBYx2ap2UFyvjuFr=BH1NfeeCZrQn93w0mtCtOje_TsmixnTA@mail.gmail.com>

On 2012-04-01, at 11:04 PM, Yongqiang Yang wrote:
> On Thu, Mar 29, 2012 at 12:08 AM, Andreas Dilger <aedilger@gmail.com> wrote:
>> I would suggest to put the backup group descriptor in the last block
>> of the filesystem.  This would be in the 0th group of the metagroup.
>> If the metagroup grows to have a second group, then this block is not
>> needed anymore, and if both the primary (at the beginning of the group)
>> and the backup (at the end of the group) are corrupted, then there is
>> little chance that the data in this last group is good either...
> 
> Now we have 2 solutions, the 1st one is storing backup group
> descriptor in resize inode itself while the 2nd one is storing backup
> in the last block of the 0th block. Both need patching e2fsck because
> older e2fsck does not work.  The 1st one's patch to e2fsck is much
> more complicated, because only one group descriptor is stored in
> resize inode itself, but the e2fsck's code reading/writing group
> descriptor block. so I like the 2nd one.

This solution doesn't _require_ patching e2fsck, which is useful.
If an older e2fsck doesn't understand the backup group descriptor is
in the last block, it is no worse than today where the backup does
not exist at all.  In that case, the old e2fsck would mark this block
free, and there is a tiny chance that it would be allocated to some
file and overwritten.

However, the last block will almost never be allocated, since block
allocation is typically biased toward the beginning of the disk, so
storing a checksum in it (per Darrick's patches) would allow a new
e2fsck to use it in case of emergency, and it would mark the block
in use again (so long as it wasn't allocated to some file).

Cheers, Andreas






  reply	other threads:[~2012-04-02  5:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 14:47 backup of the last group'descriptor when it is the 1st group of a meta_bg Yongqiang Yang
2012-03-28 16:08 ` Andreas Dilger
2012-04-02  5:04   ` Yongqiang Yang
2012-04-02  5:46     ` Andreas Dilger [this message]
2012-04-03 18:39   ` Ted Ts'o
2012-04-03 19:28     ` Andreas Dilger
2012-04-03 21:26       ` Ted Ts'o
2012-04-03 22:07         ` backup of the last group descriptor " Andreas Dilger
2012-04-04 19:28           ` Ted Ts'o

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=48603AD4-9120-41F1-A796-06684D605C57@dilger.ca \
    --to=aedilger@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=xiaoqiangnk@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.