From: Bob Peterson Date: Fri, 13 Jan 2017 10:25:09 -0500 (EST) Subject: [Cluster-devel] [libgfs2 PATCH] libgfs2: Make rg repair do better sanity checks on rindex In-Reply-To: References: <399534030.10256990.1484314819224.JavaMail.zimbra@redhat.com> Message-ID: <1493740364.10304370.1484321109469.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- | Hi Bob, | | On 13/01/17 13:40, Bob Peterson wrote: | > Hi, | > | > This patch changes the checks done on the rindex file. Before, if | > the rindex addresses weren't perfectly aligned and equally spaced, | > it considered the rindex not sane. However, in most cases it should | > be sane. Rather than flag this as a violation, I use it to trigger | > a read from disk to see if the rindex really DOES point to an rgrp | > in these cases, and if not, THEN flag the rindex as not sane. | > I also added some basic checks on the rindex values, such as | > checking if the number of bitmaps is sane, and if most of the fields | > have values we'd expect. | > | > Signed-off-by: Bob Peterson | | Thanks for working on this. Unfortunately it makes one of the nukerg | tests fail: | | | Nuking rindex entry 1. | ./fsck.at:35: fsck.gfs2 -y $GFS_TGT | stderr: | (level 1 failed: Some damage was found; we need to take remedial measures) | Block #-1 (0xffffffffffffffff) (-17 of 0) is not GFS2_METATYPE_RB. | Attempting to repair the rgrp. | bad read: Invalid argument from rewrite_rg_block:892: block | 18446744073709551615 (0xffffffffffffffff) count: 1 size: 4096 ret: -1 | | | You can reproduce this with: make check TOPTS='-k fsck' and the log will | be in tests/testsuite.dir/21/testsuite.log | | Or, manually, the test is: | | $ truncate -s 10G testvol | $ gfs2/mkfs/mkfs.gfs2 -Oplock_nolock testvol | $ tests/nukerg -i 1 testvol | $ gfs2/fsck/fsck.gfs2 -y testvol | $ gfs2/fsck/fsck.gfs2 -n testvol | | Andy Hi Andy, Hmmm...Thanks for checking this. Seems like it's already failing: [bob at vishnu ../bob/gfs2-utils/gfs2]$ brew latest-pkg rhel-7.4-candidate gfs2-utils Build Tag Built by ---------------------------------------- -------------------- ---------------- gfs2-utils-3.1.9-3.el7 rhel-7.3 anprice [root at gfs-i24c-01 /home/bob/gfs2-utils]# rpm -q gfs2-utils gfs2-utils-3.1.9-3.el7.x86_64 [root at gfs-i24c-01 /home/bob/gfs2-utils]# ls -l `which fsck.gfs2` -rwxr-xr-x 1 root root 288528 Jul 20 09:59 /usr/sbin/fsck.gfs2 [root at gfs-i24c-01 /home/bob/gfs2-utils]# mkfs.gfs2 -Oplock_nolock /dev/sasdrives/testvol |grep -i group Building resource groups: Done Resource groups: 41 [root at gfs-i24c-01 /home/bob/gfs2-utils]# tests/nukerg -i 1 /dev/sasdrives/testvol 41 rindex entries found. Nuking rindex entry 1. [root at gfs-i24c-01 /home/bob/gfs2-utils]# fsck.gfs2 -y /dev/sasdrives/testvol Initializing fsck Validating resource group index. Level 1 resource group check: Checking if all rgrp and rindex values are good. (level 1 failed: Some damage was found; we need to take remedial measures) Level 2 resource group check: Checking if rindex values may be easily repaired. The rindex file does not meet our expectations. (level 2 failed at block 0 (0x0): rindex is unevenly spaced: either gfs1-style or corrupt) Level 3 resource group check: Calculating where the rgrps should be if evenly spaced. New resource groups: L3: number of rgs in the index = 41. L3: number of rgs expected = 41. Level 3 didn't work. Too many discrepancies. 41 out of 41 rgrps (100 percent) did not match what was expected. (level 3 failed at block 0 (0x0): rindex calculations don't match: uneven rgrp boundaries) Level 4 resource group check: Trying to rebuild rindex assuming evenly spaced rgrps. Maximum number of rgrp grow segments reached. This file system cannot be repaired with fsck. *** stack smashing detected ***: fsck.gfs2 terminated Segmentation fault [root at gfs-i24c-01 /home/bob/gfs2-utils]# I'll see if I can debug it, time permitting. Regards, Bob Peterson Red Hat File Systems