Hi, I am not able to understand the use of metaecc or the ECC in the metadata. All the metadata contain the ecc to check if the data written to the block is sane, but what happens in case the ecc does not match? All it does is fail in case it does not match. There does not seem a way to correct it. fsck simply fails in ocfs2_read_inode, (or in some cases such as superblock inode (2) does not even check) if the ecc does not match. What is the best way to correct ecc errors? I understand that an incorrect ECC means the data might be corrupt, but what if we want to recover? or is it not meant to be corrected at all? Regards, -- Goldwyn
On 06/17/2011 08:55 AM, Goldwyn Rodrigues wrote:> I am not able to understand the use of metaecc or the ECC in the > metadata. All the metadata contain the ecc to check if the data > written to the block is sane, but what happens in case the ecc does > not match? All it does is fail in case it does not match. There does > not seem a way to correct it. > > fsck simply fails in ocfs2_read_inode, (or in some cases such as > superblock inode (2) does not even check) if the ecc does not match. > What is the best way to correct ecc errors? I understand that an > incorrect ECC means the data might be corrupt, but what if we want to > recover? or is it not meant to be corrected at all?I think originally our thought was that bad checksum means bad block. But we are wiser now. As in, while that works in the fs, we could to do better job in the tools. And that's the reason it is not yet enabled by default. If you have ideas, do share.
On Mon, Jun 20, 2011 at 11:22 AM, Sunil Mushran <sunil.mushran at oracle.com> wrote:> On 06/17/2011 04:16 PM, Joel Becker wrote: >> >> On Fri, Jun 17, 2011 at 12:14:36PM -0700, Sunil Mushran wrote: >>>>> >>>>> If you have ideas, do share. >>>> >>>> No ideas as such. I raised this question because a customer was facing >>>> this issue with the superblock and no way to fix it. Fortunately, he >>>> can still use the filesystem. It is debugfs.ocfs2 which is failing. I >>>> guess I will have to work on a patch to fix this. >>> >>> So I remember we had a bug in tunefs that changed the superblock >>> without recomputing the checksum. It has been fixed since. >>> >>> How can he still use the fs? >>> >>> One solution is to disable it... manually. And then re-enable it using >>> the latest tunefs. >> >> ? ? ? ?I thought we were going to patch fsck.ocfs2 to run in an >> ignore-metaecc mode? > > > Oh I did not know we had decided on that. Though that appears to be the > best solution. fsck and debugfs always run in ignore-metaecc mode. fsck > will need a fixup code for that. >Cool. I have sent a set of 3 patches on the tools mailing list. Let me know if it works for you. -- Goldwyn