Re: Questions regarding COW-related behaviors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, 08 November, 2010, João Eduardo Luís wrote:
> Hello list.
[...]
> Basically, I need to be aware how the COW works in BTRFS, and what it may 
allow one to achieve. Questions follow.
> 
> 1) Is COW only used when creating or updating a file? While testing BTRFS, 
using 'btrfs subvolume find-new', I got the idea that neither creation of 
directories, nor any kind of deletion are covered by COW. Is this right?

The command "btrfs subvolume find-new" search through the keys with type == 
BTRFS_EXTENT_DATA_KEY.
Because the COW is per disk-block basis, it is no so simple to track a change 
in a metadata (in a disk-block there are a lot of metadata). In fact there are 
a lot of false-positive.
I thought a bit about a way to compare two tree(s). But it is not so simple. 
If I understood correctly even if only a leaf is different, you have to 
compare a full branch (from the root to the leaf) of different disk-blocks.

> 
> 2) Each time a COW happens, is there any kind implicit 'snapshotting' that 
may keep track of changes around the filesystem for each COW? 
> By Rodeh's paper and some info on the wiki, I gather that a new root is 
created for each COW, due to shadowing, but will the previous tree be kept? 
The wiki, at "BTRFS Design", states that "after the commit finishes, the older 
subvolume root items may be removed". This would make impossible to track 
changes to files, but 'btrfs subvolume find-new' still manages to output file 
generations, so there must be some info left behind. 
> 
> 3) Following (2), is there any way to access this informations and, let's 
say, recover an older version of a given file? Or an entire previous tree?

Snapshotting a tree is the method to track "an older version of a given 
file"(s) or a tree. 
[...]
> 
> I would greatly appreciate any answer regarding any of this topics, 
including any pointers to additional documentation that I may have missed.
> 
> 
> Regards.
> 
> 
> ---
> João Eduardo Luís
Ciao
Goffredo
-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@xxxxxxxxx>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux