When reviewing ORI-162, it is my opinion that the FID_SEQ_LOCAL_FILE objects should not be in the OI, but rather be handled via by-name lookup only. That is no more costly than by-FID lookup, since both require a single ZAP lookup, and it may be considerably faster for these frequently-used object since the root ZAP is small and the OI will be huge.
This also avoids the problem seen here where any "by hand" modification of the underlying filesystem (which was the whole reason to make the ZFS OSD ZPL compatible) would cause the filesystem to break.
As for reasons why this may be needed in real life:
- if an OST is lost/corrupted and a new OST is formatted with the same index it is necessary to reset the lov_objids file
- if the lov_objids file is itself corrupted, being able to simply delete it and have Lustre recreate it from the OST LAST_ID data is very convenient (the only loss being a few orphaned zero-length objects on the OSTs)
- similarly, truncating or deleting the last_rcvd file to handle cases where it is corrupted (either by storage or software bug like duplicate export UUIDs), and then having Lustre recreate it is very convenient
- being able to modify the OST UUID in last_rcvd is also important on occasion
- sometimes corruption of LAST_ID needs manual repair
Ideally, these situations would all be handled automatically without need for user interaction, but that is not the case today. In most cases there could be automatic recovery (e.g. rebuild LAST_ID by scanning the O/
{seq}
/d* directories for the highest OID), but this also needs development effort, and isn't always possible to handle automatically (e.g. the OST doesn't know what is in the lov_objids file on the MDT, and getting this wrong can result in more filesystem corruption).
Since there's actually no ZFS equivalent of debugfs, I think this can be closed as a dup of
LU-2353.