This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master in repository gfs2-utils.
commit 7ec698b481bdb56c672e691be29f6ba77470beff Author: Andrew Price anprice@redhat.com AuthorDate: Fri Oct 15 12:36:27 2021 +0100
Make sure i_bh is set after lgfs2_gfs_inode_get()
This function accepts a char * instead of a bh and users expect i_bh to be set as it is in lgfs2_inode_get(). Fixes a segfault when checking gfs1 filesystems. This is kind of a temporary measure as i_bh should be removed in future in favour of separately managed i/o.
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/convert/gfs2_convert.c | 1 + gfs2/fsck/metawalk.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c index 99a2fa76..beb71af2 100644 --- a/gfs2/convert/gfs2_convert.c +++ b/gfs2/convert/gfs2_convert.c @@ -867,6 +867,7 @@ static int adjust_inode(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh) log_crit(_("Error reading inode: %s\n"), strerror(errno)); return -1; } + inode->i_bh = bh;
inode_was_gfs1 = (inode->i_num.in_formal_ino == inode->i_num.in_addr); /* Fix the inode number: */ diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c index 4f36fe63..deaa1ed8 100644 --- a/gfs2/fsck/metawalk.c +++ b/gfs2/fsck/metawalk.c @@ -284,8 +284,10 @@ struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, ip = lgfs2_gfs_inode_get(sdp, bh->b_data); else ip = lgfs2_inode_get(sdp, bh); - if (ip) + if (ip) { ip->i_rgd = rgd; + ip->i_bh = bh; + } return ip; }
cluster-commits@lists.fedorahosted.org