cluster: RHEL56 - libgfs2: dir_split_leaf needs to zero out the new leaf

Bob Peterson rpeterso at fedoraproject.org
Sat Apr 10 04:52:59 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1faaeeacae5c868e72e327e821ba118da7cbd6cd
Commit:        1faaeeacae5c868e72e327e821ba118da7cbd6cd
Parent:        10d21248358791b837772aabe06a524a01381356
Author:        Bob Peterson <bob at ganesha.peterson>
AuthorDate:    Thu Jan 21 17:15:24 2010 -0600
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Fri Apr 9 23:33:16 2010 -0500

libgfs2: dir_split_leaf needs to zero out the new leaf

The dir_split_leaf function was not clearing out the new leaf
block it had allocated, so there was likely to be trash left
on the block.  Granted, this is pretty rare, but I actually
saw it in a situation where lots of orphaned dinodes were
tossed into lost+found.

rhbz#455300
---
 gfs2/libgfs2/fs_ops.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index e9c7626..f670aa5 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -853,6 +853,8 @@ static void dir_split_leaf(struct gfs2_inode *dip, uint32_t lindex,
 		mh.mh_type = GFS2_METATYPE_LF;
 		mh.mh_format = GFS2_FORMAT_LF;
 		gfs2_meta_header_out(&mh, nbh);
+		buffer_clear_tail(dip->i_sbd, nbh,
+				  sizeof(struct gfs2_meta_header));
 	}
 
 	nleaf = (struct gfs2_leaf *)nbh->b_data;


More information about the cluster-commits mailing list