• Stefan Behrens's avatar
    Btrfs: clear received_uuid field for new writable snapshots · 70023da2
    Stefan Behrens authored
    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: default avatarStefan Behrens <sbehrens@giantdisaster.de>
    Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
    70023da2
transaction.c 51.2 KB