Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 9383e745e23602bc45f9c92184feea59 > files > 99

gfs2-utils-0.1.62-28.el5.src.rpm

commit 276b437eadbcb3a7f96a4fd008f0bb98ecdc8819
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Wed Mar 3 13:28:40 2010 -0600

    GFS2: fatal: invalid metadata block after gfs2_grow
    
    This patch adds an fsync(fd) to the bsync function of libgfs2.
    The gfs2_grow program was writing out its buffers, then
    modifying the rindex, signaling the kernel code to read in the
    new rgrp information.  The problem was caused by a timing window
    whereby the gfs2 kernel code read in the new blocks before they
    landed on disk from those write requests.
    
    rhbz#546683

diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index fd50d45..3f9e748 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -187,6 +187,7 @@ void bsync(struct buf_list *bl)
 				bh->b_blocknr, bh->b_blocknr);
 		write_buffer(bl, bh);
 	}
+	fsync(bl->sbp->device_fd);
 }
 
 /* commit buffers to disk but do not discard */