From 15d00c0b91ca776b51b5ab04f79ab35b06670d30 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Fri, 18 Aug 2006 15:51:09 -0400 Subject: [GFS2] Fix leak of gfs2_bufdata This fixes a memory leak of struct gfs2_bufdata and also some problems in the ordered write handling code. It needs a bit more testing, but I believe that the reference counting of ordered write buffers should now be correct. This is aimed at fixing Red Hat bugzilla: #201028 and #201082 Signed-off-by: Steven Whitehouse --- fs/gfs2/ops_address.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fs/gfs2/ops_address.c') diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index 45afd0508689..4c59cb110995 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c @@ -581,10 +581,8 @@ static void discard_buffer(struct gfs2_sbd *sdp, struct buffer_head *bh) if (bd) { bd->bd_bh = NULL; bh->b_private = NULL; - gfs2_log_unlock(sdp); - brelse(bh); - } else - gfs2_log_unlock(sdp); + } + gfs2_log_unlock(sdp); lock_buffer(bh); clear_buffer_dirty(bh); @@ -598,7 +596,7 @@ static void discard_buffer(struct gfs2_sbd *sdp, struct buffer_head *bh) static void gfs2_invalidatepage(struct page *page, unsigned long offset) { - struct gfs2_sbd *sdp = page->mapping->host->i_sb->s_fs_info; + struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host); struct buffer_head *head, *bh, *next; unsigned int curr_off = 0; -- cgit v1.2.3-59-g8ed1b