Description of problem: gfs2_edit -p block# should print the content of the block. It does so until you hit last block of links (pointing directly to data). This scenario causes gfs2_edit print wrong height and some nonsense as data offset on GFS1 filesystem. Same scenario on GFS2 filesystem ends with segmentation fault. Version-Release number of selected component (if applicable): gfs2_edit version 0.1.58 (built May 29 2009 15:43:58) gfs-utils-0.1.19-3.el5 gfs2-utils-0.1.58-1.el5 kmod-gfs-0.1.33-2.el5 How reproducible: always Steps to Reproduce: 1. mkfs.gfs -O -t a3cluster:a3gfs2 -p lock_nolock -j 2 -J 32 ${DEVICE} or 1. mkfs.gfs2 -O -t a3cluster:a3gfs2 -p lock_nolock -j 2 -J 8 ${DEVICE} 2. mount and create 10M file (yes | head -c 10000000 > file-01) 3. use gfs2_edit to walk through the filesystem and walk through the created file. Every time you change block# in the interactive editor, try "gfs2_edit -p block# ${DEVICE}" with the same block# as you see in the header of the editor. 4. at last page the height will be different and data offset will be a nonsense Actual results: different values for different usage of gfs2_edit Expected results: values are the same, utility does not crash Additional info: GFS1 (1G filesystem, 10M file): gfs2_edit -p '35' /dev/GFSVG/GFS Block #35 (0x23) of 262144 (0x40000) (indir blklist) Indirect Block: mh_magic 0x01161970(hex) mh_type 5 0x5 mh_format 500 0x1f4 This indirect block contains 1 indirect blocks (at height=2) Indirect blocks: 0 => 0x9e2 / 2530 (data offset 0x57ff500000000000 / 6340874761291169792 / 5.50E) GFS2: segfault with: Core was generated by `gfs2_edit -p 5143 /dev/GFSVG/GFS'. Program terminated with signal 11, Segmentation fault. [New process 28810] #0 0x0000000000401fea in print_gfs2 (fmt=Cannot access memory at address 0x790a790a790a7732 ) at gfs2hex.c:95 95 } (gdb) bt full #0 0x0000000000401fea in print_gfs2 (fmt=Cannot access memory at address 0x790a790a790a7732 ) at gfs2hex.c:95 args = Cannot access memory at address 0x790a790a790a783a The address here seems like the data read from the data block (all "y") Remark: it seems to work on ia64 for GFS1. For GFS2 the segfault occurs.
I've known about this bug for a very long time. It's in the gfs2 debugger tool, gfs2_edit, so low priority, but it should get fixed. Requesting ack flags so we can fix it in RHEL5.5.
Created attachment 357855 [details] Patch to fix the problem Although it's not real straightforward, this patch fixes the problem for both interactive and print mode. I haven't tested heights > 2.
Created attachment 359452 [details] Revised patch This patch fixes a bug I found while testing the previous patch.
The patch was pushed to the master branch of the gfs2-utils git repository and the STABLE3, STABLE2 and RHEL55 branches of the cluster git repository for inclusion into 5.5. Changing status to POST while I do builds. RHEL55: 90097fd master: 7ad8cc8 STABLE3: 03a04c4 STABLE2: 9193f20
Build complete and successful. Changing status to Modified.
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-2010-0287.html