Btrfs: clear received_uuid field for new writable snapshots
authorStefan Behrens <sbehrens@giantdisaster.de>
Wed, 17 Apr 2013 09:11:47 +0000 (09:11 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:54:58 +0000 (15:54 -0400)
commit70023da276ed7a46201e7b0d3168b005ad82fecb
treeda021e72c9abb8ca8d9143eaa8dce6d16154e467
parentb8d7f3ac10a865ca727f9373a796ef8537e3a474
Btrfs: clear received_uuid field for new writable snapshots

For created snapshots, the full root_item is copied from the source
root and afterwards selectively modified. The current code forgets
to clear the field received_uuid. The only problem is that it is
confusing when you look at it with 'btrfs subv list', since for
writable snapshots, the contents of the snapshot can be completely
unrelated to the previously received snapshot.
The receiver ignores such snapshots anyway because he also checks
the field stransid in the root_item and that value used to be reset
to zero for all created snapshots.

This commit changes two things:
- clear the received_uuid field for new writable snapshots.
- don't clear the send/receive related information like the stransid
  for read-only snapshots (which makes them useable as a parent for
  the automatic selection of parents in the receive code).

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/transaction.c