Description of problem: If you have a large enough directory, gfs2_edit savemeta won't save all of its leaf blocks. Version-Release number of selected component (if applicable): RHEL56 How reproducible: Always Steps to Reproduce: 1. mkfs.gfs2 -O -t bobs_roth:roth_lv -p lock_dlm -j 4 /dev/roth_vg/roth_lv 2. mount -tgfs2 /dev/roth_vg/roth_lv /mnt/gfs2 3. mkdir /mnt/gfs2/bigdir 4. for i in `seq 1 543562` ; do dd if=/dev/zero of=/mnt/gfs2/bigdir/gfs2.$i bs=4K count=3 &>/dev/null; done 5. umount /mnt/gfs2 6. gfs2_edit savemeta /dev/roth_vg/roth_lv halfamillion12Kfiles.meta 7. gfs2_edit printsavedmeta halfamillion12Kfiles.meta > /tmp/gronk 8. grep "directory leaf" /tmp/gronk | wc -l Actual results: 0 Expected results: 10214 Additional info: Patch in hand
Requesting ack flags for 5.7.
Created attachment 480259 [details] Patch to fix the problem Tested on roth-01
The patch was pushed upstream to the master branch of the gfs2-utils git repo. It was tested on my F14 desktop.
Created attachment 485801 [details] Better version of the patch
The latest patch has been pushed to the RHEL57 branch of the cluster.git repository for inclusion into 5.7. Changing status to POST until this gets built.
Verified with package gfs2-utils-0.1.62-30.el5, kernel 2.6.18-261.el5
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: This field is the basis of the errata or release note for this bug. It can also be used for change logs. The Technical Note template, known as CCFR, is as follows: Cause What actions or circumstances cause this bug to present. Consequence What happens when the bug presents. Fix What was done to fix the bug. Result What now happens when the actions or circumstances above occur. Note: this is not the same as the bug doesn’t present anymore.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,13 +1,12 @@ -This field is the basis of the errata or release note for this bug. It can also be used for change logs. - -The Technical Note template, known as CCFR, is as follows: - Cause - What actions or circumstances cause this bug to present. +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. + Consequence - What happens when the bug presents. +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. + Fix - What was done to fix the bug. +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. + Result - What now happens when the actions or circumstances above occur. +With the directory hash table processed properly, all leaf blocks are saved properly.- Note: this is not the same as the bug doesn’t present anymore.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-1042.html