Commit 88721877 authored by Russell Cattelan's avatar Russell Cattelan Committed by Steven Whitehouse
Browse files

[GFS2] Fix a couple of refcount leaks.



recovery.c add a brelse to deal with gfs2_replay_read_block being called
twice on the same block.

add a dput to drop the ref count on the root inode.
This was causing lingering glocks and thus causing
a mount failure to hang.

Fix a endian conversion macro that was was swizzling
16bits when it should have been swizzling 32.

Signed-off-by: default avatarRussell Cattelan <cattelan@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 4a99c3d9
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2167,7 +2167,9 @@ static int dump_glock(struct gfs2_glock *gl)

	spin_lock(&gl->gl_spin);

	printk(KERN_INFO "Glock (%u, %llu)\n", gl->gl_name.ln_type,
	printk(KERN_INFO "Glock 0x%p (%u, %llu)\n",
	       gl,
	       gl->gl_name.ln_type,
	       (unsigned long long)gl->gl_name.ln_number);
	printk(KERN_INFO "  gl_flags =");
	for (x = 0; x < 32; x++)
@@ -2187,7 +2189,8 @@ static int dump_glock(struct gfs2_glock *gl)
	printk(KERN_INFO "  reclaim = %s\n",
		    (list_empty(&gl->gl_reclaim)) ? "no" : "yes");
	if (gl->gl_aspace)
		printk(KERN_INFO "  aspace = %lu\n",
		printk(KERN_INFO "  aspace = 0x%p nrpages = %lu\n",
		       gl->gl_aspace,
		       gl->gl_aspace->i_mapping->nrpages);
	else
		printk(KERN_INFO "  aspace = no\n");
+4 −0
Original line number Diff line number Diff line
@@ -279,6 +279,10 @@ static int init_sb(struct gfs2_sbd *sdp, int silent, int undo)
	int error = 0;

	if (undo) {
		if (sb->s_root) {
			dput(sb->s_root);
			sb->s_root = NULL;
		}
		return 0;
	}
	
+2 −1
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start,
			error = get_log_header(jd, start, &lh);
			if (!error) {
				gfs2_replay_incr_blk(sdp, &start);
				brelse(bh);
				continue;
			}
			if (error == 1) {
@@ -396,7 +397,7 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
	lh = (struct gfs2_log_header *)bh->b_data;
	memset(lh, 0, sizeof(struct gfs2_log_header));
	lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
	lh->lh_header.mh_type = cpu_to_be16(GFS2_METATYPE_LH);
	lh->lh_header.mh_type = cpu_to_be32(GFS2_METATYPE_LH);
	lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH);
	lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1);
	lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT);