I wonder if dmu_recv_begin_check() -> recv_begin_check_existing_impl() should
fail in the following case:
- full stream, fromguid == 0
- tofs already exists
- tofs does not have any snapshots [*]
- force is false

In my opinion there is no way that this could succeed.
But right now this seem to succeed only to fail later in dmu_recv_end_check()
(with ETXTBSY). That seems like suboptimal behavior.

Also, if tofs has any snapshots then dmu_recv_begin_check() fails.  But I do not
see why the check should succeed even when there are no snapshots.
Additionally, in this case dmu_recv_begin_check() returns ENODEV, which in this
context is typically interpreted to mean that a source of an incremental stream
does not match a latest snapshot of a target filesystem.  That's a little bit
confusing since we have a full stream.  Maybe it would have better to return
EEXIST signalling that the target filesystem exists.


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

Reply via email to