Ethan Quach wrote:
> 
> Evan Layton wrote:
>>>
>>> I don't think you can make this change without the other.
>>> For the single BE case now, you don't ever process the root
>>> dataset's snapshots.  Maybe just do a simple if/else to call
>>> either zfs_iter_children/filesystem for the corresponding
>>> need?
>>>
>>
>> Actually this does work because the zfs_iter_filesystem is only used
>> for the initial root dataset. 
> 
> Have you tested this?  Based on code inspection, I see it only
> iterating down the root dataset's children *filesystems*, I
> don't see how the root dataset's snapshots ever get processed.

Yes of course I've tested this. :-)

It iterates the root dataset then inside be_add_children it iterates
through the root dataset's snapshots and datasets using
zfs_iter_children. It is this zfs_iter_children call at the end of
be_add_children which will process the snapshots for the root dataset.

> 
>> All subsequent datasets and snapshots
>> are processed inside be_add_children which calls zfs_iter_children.
>> Because of this the snapshots for the single BE case are processed as
>> well.
> 
> But this would only process snapshots of any subordinate datasets
> of that BE, not snapshots of the root dataset of the BE itself.
> 

No it will process all of the children of the root dataset including
it's snapshots and subordinate datasets since both are it's children.
The snapshots of the subordinate datasets won't be processed until
the zfs_iter_children call is made when that subordinate dataset is
processed.

> 
>> This is a case of my paranoia. We should never get into a situation
>> where we're already processed a snapshot and need to skip it but just
>> in case I added this to make sure in the very unlikely event that we
>> did already have this snapshot that it didn't get added twice. I can
>> either remove this code or add to the comment the fact that we should
>> never get into this situation.
> 
> I'd much rather you remove it.

done.

Thanks!
-evan

Reply via email to