cluster: RHEL6 - libgfs2: Use dinode buffer to map gfs1 dinode blocks

Bob Peterson rpeterso at fedoraproject.org
Tue Jan 24 20:45:54 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e411d72a57ee6b8e720db6e49c8de58a2b4d3501
Commit:        e411d72a57ee6b8e720db6e49c8de58a2b4d3501
Parent:        acee2940261ea454b8f82fcc55827a3e97ad0049
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Wed Aug 10 10:33:49 2011 -0500
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Fri Jan 20 08:26:27 2012 -0600

libgfs2: Use dinode buffer to map gfs1 dinode blocks

When function gfs1_block_map found a block for a stuffed file it
wasn't returning the dinode buffer, it was returning the block as a
new buffer.  The problem is, if changes are made to the block, they
will be overwritten by the dinode buffer when that is released.
The result is a fixed block that doesn't get fixed.  This patch
changes the code to return the block properly like gfs2_block_map.

rhbz#675723
---
 gfs2/libgfs2/gfs1.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/gfs2/libgfs2/gfs1.c b/gfs2/libgfs2/gfs1.c
index 59eaa8d..2ace124 100644
--- a/gfs2/libgfs2/gfs1.c
+++ b/gfs2/libgfs2/gfs1.c
@@ -118,7 +118,10 @@ void gfs1_block_map(struct gfs2_inode *ip, uint64_t lblock, int *new,
 			mh.mh_format = GFS2_FORMAT_IN;
 			gfs2_meta_header_out(&mh, bh);
 		} else {
-			bh = bread(sdp, *dblock);
+			if (*dblock == ip->i_di.di_num.no_addr)
+				bh = ip->i_bh;
+			else
+				bh = bread(sdp, *dblock);
 		}
 	}
 


More information about the cluster-commits mailing list