From: Bob Peterson Date: Wed, 12 Dec 2007 10:44:56 -0600 Subject: [Cluster-devel] [GFS2] [Patch 4/10] Get rid of sd_statfs_mutex In-Reply-To: <1197474992.3394.29.camel@menhir.chygwyn.com> References: <1197421489.23671.36.camel@technetium.msp.redhat.com> <1197451112.3394.1.camel@menhir.chygwyn.com> <1197473468.23671.78.camel@technetium.msp.redhat.com> <1197474992.3394.29.camel@menhir.chygwyn.com> Message-ID: <1197477896.23671.82.camel@technetium.msp.redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, 2007-12-12 at 15:56 +0000, Steven Whitehouse wrote: > I don't see why it needs to be "protected", I think that mutex is just a > bug in that case unless you can prove otherwise... it seems to be doing > nothing, > > Steve. Hi, In that case, here is my revision: Regards, Bob Peterson -- fs/gfs2/super.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -686,8 +686,9 @@ void gfs2_statfs_change(struct gfs2_sbd if (error) return; - spin_lock(&sdp->sd_statfs_spin); gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); + + spin_lock(&sdp->sd_statfs_spin); l_sc->sc_total += total; l_sc->sc_free += free; l_sc->sc_dinodes += dinodes; @@ -733,8 +734,9 @@ int gfs2_statfs_sync(struct gfs2_sbd *sd if (error) goto out_bh2; - spin_lock(&sdp->sd_statfs_spin); gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); + + spin_lock(&sdp->sd_statfs_spin); m_sc->sc_total += l_sc->sc_total; m_sc->sc_free += l_sc->sc_free; m_sc->sc_dinodes += l_sc->sc_dinodes;