This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit f319009d99b5da7f379daa179474610d7d5e530c
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Fri May 15 20:53:58 2020 +0100
savemeta: Don't save bad xattr blocks twice
This could only happen if the xattr block has a corrupt mh_type.
We've already saved the xattr block by the time we figure out that we
can't recognise its mh type so don't bother saving it again there.
Also relax mh type checking for the xattr blocks so that we save as much
of the (possibly corrupt) fs as possible. Just use the mh_type field to
decide whether to save indirect pointers or xattrs.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index b44e887..10e3bcc 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -789,31 +789,15 @@ static void save_inode_data(struct metafd *mfd, uint64_t iblk)
}
}
if (inode->i_di.di_eattr) { /* if this inode has extended attributes */
- struct gfs2_meta_header mh;
struct gfs2_buffer_head *lbh;
+ int mhtype;
lbh = bread(&sbd, inode->i_di.di_eattr);
- save_block(sbd.device_fd, mfd, inode->i_di.di_eattr, iblk, NULL);
- gfs2_meta_header_in(&mh, lbh->b_data);
- if (mh.mh_magic == GFS2_MAGIC &&
- mh.mh_type == GFS2_METATYPE_EA)
+ save_block(sbd.device_fd, mfd, inode->i_di.di_eattr, iblk, &mhtype);
+ if (mhtype == GFS2_METATYPE_EA)
save_ea_block(mfd, lbh->b_data, iblk);
- else if (mh.mh_magic == GFS2_MAGIC &&
- mh.mh_type == GFS2_METATYPE_IN)
+ else if (mhtype == GFS2_METATYPE_IN)
save_indirect_blocks(mfd, cur_list, lbh, iblk, 2, 2);
- else {
- if (mh.mh_magic == GFS2_MAGIC) /* if it's metadata */
- save_block(sbd.device_fd, mfd, inode->i_di.di_eattr,
- iblk, NULL);
- fprintf(stderr,
- "\nWarning: corrupt extended "
- "attribute at block %llu (0x%llx) "
- "detected in inode %lld (0x%llx).\n",
- (unsigned long long)inode->i_di.di_eattr,
- (unsigned long long)inode->i_di.di_eattr,
- (unsigned long long)iblk,
- (unsigned long long)iblk);
- }
brelse(lbh);
}
inode_put(&inode);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.