Re: basic questions regarding COW in Btrfs

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

 



On Sat, Mar 2, 2013 at 4:07 PM, Alex Lyakas
<alex.btrfs@xxxxxxxxxxxxxxxxx> wrote:
> Hi Josef,
> I hope it's ok to piggy back on this thread for the following question:
>
> I see that in btrfs_cross_ref_exist()=>check_committed_ref() path,
> there is the following check:
>
> if (btrfs_extent_generation(leaf, ei) <=
>     btrfs_root_last_snapshot(&root->root_item))
>         goto out;
>
> So this basically means that after we have taken a snap of a subvol,
> then all subvol's extents must be COW'ed, even if we delete the snap a
> minute later.
> I wonder, why is that so?
> Is this because file extents can be shared indirectly, like when we
> create a snap, we only COW the root and only mark all root's
> *immediate* children shared in the extent tree?

Yes that's exactly it.  We have no way of knowing that there are no
snapshots left for this particular root so if there ever was a
snapshot we have to err on the side of caution.

> Can the new backref walking code be used here to check more
> accurately, if the extent is shared by anybody else?
>

Probably, if we could figure out if there is a way for more than one
root to point to this extent then yes this would be ideal so we don't
have to force COW in cases we would rather not.  Thanks,

Josef
--
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