On 06/05/2015 02:29, Matthew Ahrens wrote:
> 
> 
> On Fri, Apr 24, 2015 at 6:29 AM, Andriy Gapon <[email protected]
> <mailto:[email protected]>> wrote:
> 
> 
>     BTW, there is another boundary case for zfs_ioc_recv().
>     If the desired destination snapshot already exists then EEXIST is always 
> return.
>      On the one hand, this totally makes sense.  On the other hand, if we are 
> doing
>     force-receiving and the conflicting local snapshot would be destroyed if 
> it had
>     a different name, then maybe we should just destroy it and reuse the name?
> 
>     In other words, if the snapshot already exists then:
>     - if !force -> EEXIST
>     - if force and the snapshot is later than drba_snapobj, then destroy the
>     snapshot and proceed to receive the stream
>     - otherwise -> EEXIST
> 
> 
> Sure, if you can make that work, the behavior sounds reasonable.

I tried to make this work and it was relatively easy to do in
recv_begin_check_existing_impl().  But dmu_recv_end_check() needs to be patched
up as well, otherwise dsl_dataset_snapshot_check_impl() would fail with EEXIST.
And so far I couldn't figure out a good way to do that.
Not sure if I want to spend much time on this at the moment.

In any case, thank you for the feedback !
-- 
Andriy Gapon
_______________________________________________
developer mailing list
[email protected]
http://lists.open-zfs.org/mailman/listinfo/developer

Reply via email to