* About Chunk Tree recover
@ 2013-01-29 11:13 Miao Xie
2013-01-29 15:33 ` Chris Mason
0 siblings, 1 reply; 2+ messages in thread
From: Miao Xie @ 2013-01-29 11:13 UTC (permalink / raw)
To: Linux Btrfs
Hi, everyone.
About 1 years ago, we implemented the chunk tree recover function,
but it has not been applied till now because that implementation
need change the disk format.
(http://marc.info/?l=linux-btrfs&m=129914269932543&w=2
http://marc.info/?l=linux-btrfs&m=130976668006281&w=2
http://marc.info/?l=linux-btrfs&m=129914269932543&w=2)
Recently, I reconsidered the implementation of this function, and
found a new approach that needn't change the disk format. That is
the external chunk tree backup, just like external journal device
of ext4. The basic idea is:
- specify a external file or device which is used to backup the
chunk tree when mount.
- When mount, compare the super block in the external file/device
with the super block of the btrfs, if the checksum of the super
block in the externel file/device is right, and the FS UUID and
generation are the same as the fs, it means the chunk tree in
the external file/device is valid, needn't rebuild it. Otherwise,
we will rebuild the chunk tree in the external file/device
according to the chunk tree of the fs.
- When we allocate a new chunk, we will log the new chunk
information into the external file/device
- sync the external file/device when committing the transaction
- If the chunk tree of the fs is corrupted, we use the information
in the external file/device to recover it.
By this way, we needn't change disk format and also needn't do a
block device scan which need lots of time, and is very hard to
find the start address and length of a chunk.
Any comment for this idea?
Thanks
Miao
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: About Chunk Tree recover
2013-01-29 11:13 About Chunk Tree recover Miao Xie
@ 2013-01-29 15:33 ` Chris Mason
0 siblings, 0 replies; 2+ messages in thread
From: Chris Mason @ 2013-01-29 15:33 UTC (permalink / raw)
To: Miao Xie; +Cc: Linux Btrfs
On Tue, Jan 29, 2013 at 04:13:47AM -0700, Miao Xie wrote:
> Hi, everyone.
>
> About 1 years ago, we implemented the chunk tree recover function,
> but it has not been applied till now because that implementation
> need change the disk format.
> (http://marc.info/?l=linux-btrfs&m=129914269932543&w=2
> http://marc.info/?l=linux-btrfs&m=130976668006281&w=2
> http://marc.info/?l=linux-btrfs&m=129914269932543&w=2)
>
> Recently, I reconsidered the implementation of this function, and
> found a new approach that needn't change the disk format. That is
> the external chunk tree backup, just like external journal device
> of ext4. The basic idea is:
I do like the idea of a dedicated chunk backup area, outside the
filesystem. But, I think we need to be able to fall back to the
scanning operation.
The chunk tree backup actually fits well into the log area I'm setting
up for raid5/6. The log area is really just a dedicated chunk where I'm
stuffing blocks to avoid read/modify/write and to make sub stripe writes
power cut safe.
-chris
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-29 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 11:13 About Chunk Tree recover Miao Xie
2013-01-29 15:33 ` Chris Mason
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).