This is good, but it's a little confusing when reading the code because it 
isn't clear how we could get into this scenario.  We could add a comment 
(similar to what you described in the message above), but it might be more 
clear to solve this with a change to a more relevant code path:

In zfs_rezget(), we could treat `z_links == 0` the same as if the file's 
deletion had completed on the source, and the object is no longer allocate 
(which is also the same as `gen != z_gen`), i.e. not reassociate this znode 
with the underlying object.  Then if we try to access this file, we'll get EIO 
(see ZFS_VERIFY_ZP()).  In addition to making it a little easier to understand 
the code, this also means that you couldn't see a partially-deleted file on the 
target (e.g. if we snapshotted this fs while the object is in the middle of 
being incrementally destroyed by dmu_free_long_range).  We could change the 
code in zfs_zinactive() to an assertion, with a comment explaining why we can't 
see unlinked objects on a readonly mount.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/464#issuecomment-328889887
------------------------------------------
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/Tf5d8079d50248fc8-M6560954ec3ae5ac8cadde41b
Powered by Topicbox: https://topicbox.com

Reply via email to