Skip to contentSkip to conversation

Initialize extent_list earlier

PATCH New Bob Peterson 2 participants 2 messages Jan 3, 2008 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Initialize extent_list earlier

Hi,

Here is a patch for the latest upstream GFS2 code:
The journal extent map needs to be initialized sooner than it currently is. Otherwise failed mount attempts (e.g. not enough journals, etc.) may panic trying to access the uninitialized list.

Regards,

Bob Peterson

--

 fs/gfs2/ops_fstype.c |    1 -
 fs/gfs2/super.c      |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/ops_fstype.c +0 -1
index a77d41f..9ffc10b 100644
@@ -330,7 +330,6 @@ static int map_journal_extents(struct gfs2_sbd *sdp)
 	struct buffer_head bh;
 	int rc = 0;
 
-	INIT_LIST_HEAD(&jd->extent_list);
 	prev_db = 0;
 
 	for (lb = 0; lb < ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; lb++) {
fs/gfs2/super.c +1 -0
index 73e49df..fa86038 100644
@@ -385,6 +385,7 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
 		if (!jd)
 			break;
 
+		INIT_LIST_HEAD(&jd->extent_list);
 		jd->jd_inode = gfs2_lookupi(sdp->sd_jindex, &name, 1, NULL);
 		if (!jd->jd_inode || IS_ERR(jd->jd_inode)) {
 			if (!jd->jd_inode)
#1 lore raw

PATCH 1/1 Initialize extent_list earlier

Hi,

Now in the -nmw git tree. Thanks,

Steve.

Quoted 43 lines · Bob Peterson

Hi,

Here is a patch for the latest upstream GFS2 code:
The journal extent map needs to be initialized sooner than it currently is. Otherwise failed mount attempts (e.g. not enough journals, etc.) may panic trying to access the uninitialized list.

Regards,

Bob Peterson

--

 fs/gfs2/ops_fstype.c |    1 -
 fs/gfs2/super.c      |    1 +
 2 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/ops_fstype.c +0 -1
index a77d41f..9ffc10b 100644
@@ -330,7 +330,6 @@ static int map_journal_extents(struct gfs2_sbd *sdp)
 	struct buffer_head bh;
 	int rc = 0;
 
-	INIT_LIST_HEAD(&jd->extent_list);
 	prev_db = 0;
 
 	for (lb = 0; lb < ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; lb++) {
fs/gfs2/super.c +1 -0
index 73e49df..fa86038 100644
@@ -385,6 +385,7 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
 		if (!jd)
 			break;
 
+		INIT_LIST_HEAD(&jd->extent_list);
 		jd->jd_inode = gfs2_lookupi(sdp->sd_jindex, &name, 1, NULL);
 		if (!jd->jd_inode || IS_ERR(jd->jd_inode)) {
 			if (!jd->jd_inode)