aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRussell Cattelan <cattelan@redhat.com>2006-08-10 12:08:40 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-08-10 17:18:59 -0400
commit8872187780f6104216c67e7b60c11f708b513c38 (patch)
tree690823763a87d7cd4c90e94760319414e2fc4ad6 /fs
parent4a99c3d9d6663085e28bc7ac8dae1e985c5a6174 (diff)
[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: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/glock.c9
-rw-r--r--fs/gfs2/ops_fstype.c4
-rw-r--r--fs/gfs2/recovery.c3
3 files changed, 12 insertions, 4 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index b6edf7c0923b..a5e16e539999 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -2167,7 +2167,9 @@ static int dump_glock(struct gfs2_glock *gl)
2167 2167
2168 spin_lock(&gl->gl_spin); 2168 spin_lock(&gl->gl_spin);
2169 2169
2170 printk(KERN_INFO "Glock (%u, %llu)\n", gl->gl_name.ln_type, 2170 printk(KERN_INFO "Glock 0x%p (%u, %llu)\n",
2171 gl,
2172 gl->gl_name.ln_type,
2171 (unsigned long long)gl->gl_name.ln_number); 2173 (unsigned long long)gl->gl_name.ln_number);
2172 printk(KERN_INFO " gl_flags ="); 2174 printk(KERN_INFO " gl_flags =");
2173 for (x = 0; x < 32; x++) 2175 for (x = 0; x < 32; x++)
@@ -2187,8 +2189,9 @@ static int dump_glock(struct gfs2_glock *gl)
2187 printk(KERN_INFO " reclaim = %s\n", 2189 printk(KERN_INFO " reclaim = %s\n",
2188 (list_empty(&gl->gl_reclaim)) ? "no" : "yes"); 2190 (list_empty(&gl->gl_reclaim)) ? "no" : "yes");
2189 if (gl->gl_aspace) 2191 if (gl->gl_aspace)
2190 printk(KERN_INFO " aspace = %lu\n", 2192 printk(KERN_INFO " aspace = 0x%p nrpages = %lu\n",
2191 gl->gl_aspace->i_mapping->nrpages); 2193 gl->gl_aspace,
2194 gl->gl_aspace->i_mapping->nrpages);
2192 else 2195 else
2193 printk(KERN_INFO " aspace = no\n"); 2196 printk(KERN_INFO " aspace = no\n");
2194 printk(KERN_INFO " ail = %d\n", atomic_read(&gl->gl_ail_count)); 2197 printk(KERN_INFO " ail = %d\n", atomic_read(&gl->gl_ail_count));
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index de18923eea70..444000968cf4 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -279,6 +279,10 @@ static int init_sb(struct gfs2_sbd *sdp, int silent, int undo)
279 int error = 0; 279 int error = 0;
280 280
281 if (undo) { 281 if (undo) {
282 if (sb->s_root) {
283 dput(sb->s_root);
284 sb->s_root = NULL;
285 }
282 return 0; 286 return 0;
283 } 287 }
284 288
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index bbd44a4b1a1f..8fe518cfb3de 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -325,6 +325,7 @@ static int foreach_descriptor(struct gfs2_jdesc *jd, unsigned int start,
325 error = get_log_header(jd, start, &lh); 325 error = get_log_header(jd, start, &lh);
326 if (!error) { 326 if (!error) {
327 gfs2_replay_incr_blk(sdp, &start); 327 gfs2_replay_incr_blk(sdp, &start);
328 brelse(bh);
328 continue; 329 continue;
329 } 330 }
330 if (error == 1) { 331 if (error == 1) {
@@ -396,7 +397,7 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header *head)
396 lh = (struct gfs2_log_header *)bh->b_data; 397 lh = (struct gfs2_log_header *)bh->b_data;
397 memset(lh, 0, sizeof(struct gfs2_log_header)); 398 memset(lh, 0, sizeof(struct gfs2_log_header));
398 lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC); 399 lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
399 lh->lh_header.mh_type = cpu_to_be16(GFS2_METATYPE_LH); 400 lh->lh_header.mh_type = cpu_to_be32(GFS2_METATYPE_LH);
400 lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH); 401 lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH);
401 lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1); 402 lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1);
402 lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT); 403 lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT);