On 24/04/2015 00:00, Matthew Ahrens wrote:
> On Thu, Apr 23, 2015 at 1:24 PM, Andriy Gapon <[email protected]> 
> wrote:
>     It seems that any filesystem is considered modified when compared to 
> $ORIGIN.
>     And ds_prev of a filesystem without any real snapshots points to $ORIGIN.
>     Or is it $ORIGIN@$ORIGIN actually?
> 
> 
> Yes.  And the filesystems actually *are* modified, compared to the
> $ORIGIN@$ORIGIN.  They have been initialized by the ZPL (or zvol), e.g. to
> contain the root directory.  Whereas the $ORIGIN@$ORIGIN is truly empty from 
> the
> DSL/DMU point of view -- it has no blocks.

This totally makes sense - thank you for the explanation!

I see another curious / not-entirely-expected thing about zfs receive.
If a destination filesystem has been modified since the last received snapshot -
if any, and it also has at least one newer local snapshots, and a stream is
received into that filesystem, and the force flag is true, then:
* if the stream is incremental, then all the newer snapshots are destroyed, the
filesystem is virtually rolled back to the latest received snapshot and then the
stream is applied;
* if the stream is full, then the operation fails despite the force flag.

However, if the destination filesystem is modified but there are no newer
snapshots, then in both cases the operation succeeds: any local modifications
are discarded and the stream is applied.

So, I wonder what a rationale is for not destroying the local snapshots if a
full stream is force-received into the existing and modified and "snapshotted"
filesystem.

Maybe this is a bug and recv_begin_check_existing_impl() needs to take into
account the force flag for the full stream case as well.

-- 
Andriy Gapon
_______________________________________________
developer mailing list
[email protected]
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to