Skip to contentSkip to conversation

ocfs2: release the buffer head in ocfs2_do_truncate.

PATCH New Tao Ma 2 participants 2 messages Aug 12, 2009 – Aug 17, 2009 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2: release the buffer head in ocfs2_do_truncate.

In ocfs2_do_truncate, we forget to release last_eb_bh which will cause memleak. So call brelse in the end.

---
 fs/ocfs2/alloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/alloc.c +1 -1
index f9a3e89..ab513dd 100644
@@ -6851,7 +6851,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
 	}
 	status = 0;
 bail:
-
+	brelse(last_eb_bh);
 	mlog_exit(status);
 	return status;
 }
Signature · 1 line
1.5.5
#1 lore raw

PATCH 1/1 ocfs2: release the buffer head in ocfs2_do_truncate.

Quoted 4 lines · Tao Ma

In ocfs2_do_truncate, we forget to release last_eb_bh which will cause memleak. So call brelse in the end.

This is now in the fixes branch of ocfs2.git

Joel

Quoted 20 lines
---
 fs/ocfs2/alloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/alloc.c +1 -1
index f9a3e89..ab513dd 100644
@@ -6851,7 +6851,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb,
 	}
 	status = 0;
 bail:
-
+	brelse(last_eb_bh);
 	mlog_exit(status);
 	return status;
 }
Signature · 1 line
1.5.5
Signature · 9 lines
Life's Little Instruction Book #182

	"Be romantic."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127