A user performs the command "gfs2_edit savemeta" to save off the metadata for a target GFS2 file system. However, not all of the directory information is saved for large directories. If the metadata is restored to another device, fsck.gfs2 will find directory corruption due to missing leaf blocks.
The bug was caused because gfs2_edit was treating the directory leaf index (known as the directory hash table) like it did a normal data file. In other words, a collection of metadata blocks. For a normal data file gfs2_edit needs to save only the metadata blocks, but not the user's data blocks. For a directory, gfs2_edit needs to save the "data" because the "data" blocks are the actual
directory hash table, and the blocks beneath it are the directory leaf blocks that also need to be saved.
The fix was to change gfs2_edit's savemeta function to actually read all the data (i.e. the directory hash table) for large directories and traverse the hash table, saving all the leaf blocks.
With the directory hash table processed properly, all leaf blocks are saved properly.