Hi,
On Tue, 2007-12-11 at 19:04 -0600, Bob Peterson wrote:
> Hi,
>
> This patch eliminates the sd_statfs_mutex variable when doing
> updates to local statfs change files. The new code uses the
> sd_statfs_spin spin_lock that's already taken to get the same
> effect.
>
> Regards,
>
> Bob Peterson
> Red Hat GFS
>
> Signed-off-by: Bob Peterson <[EMAIL PROTECTED]>
> --
> .../fs/gfs2/incore.h | 1 -
> .../fs/gfs2/ops_fstype.c | 1 -
> .../fs/gfs2/super.c | 10 ++--------
> 3 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/gfs2-2.6.git.patch3/fs/gfs2/incore.h
> b/gfs2-2.6.git.patch4/fs/gfs2/incore.h
> index 14862d1..9a83429 100644
> --- a/gfs2-2.6.git.patch3/fs/gfs2/incore.h
> +++ b/gfs2-2.6.git.patch4/fs/gfs2/incore.h
> @@ -527,7 +527,6 @@ struct gfs2_sbd {
> /* StatFS stuff */
>
> spinlock_t sd_statfs_spin;
> - struct mutex sd_statfs_mutex;
> struct gfs2_statfs_change_host sd_statfs_master;
> struct gfs2_statfs_change_host sd_statfs_local;
> unsigned long sd_statfs_sync_time;
> diff --git a/gfs2-2.6.git.patch3/fs/gfs2/ops_fstype.c
> b/gfs2-2.6.git.patch4/fs/gfs2/ops_fstype.c
> index 35ec630..22e260e 100644
> --- a/gfs2-2.6.git.patch3/fs/gfs2/ops_fstype.c
> +++ b/gfs2-2.6.git.patch4/fs/gfs2/ops_fstype.c
> @@ -60,7 +60,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
>
> mutex_init(&sdp->sd_inum_mutex);
> spin_lock_init(&sdp->sd_statfs_spin);
> - mutex_init(&sdp->sd_statfs_mutex);
>
> spin_lock_init(&sdp->sd_rindex_spin);
> mutex_init(&sdp->sd_rindex_mutex);
> diff --git a/gfs2-2.6.git.patch3/fs/gfs2/super.c
> b/gfs2-2.6.git.patch4/fs/gfs2/super.c
> index dda7747..da5b29c 100644
> --- a/gfs2-2.6.git.patch3/fs/gfs2/super.c
> +++ b/gfs2-2.6.git.patch4/fs/gfs2/super.c
> @@ -686,11 +686,8 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total,
> s64 free,
> if (error)
> return;
>
> - mutex_lock(&sdp->sd_statfs_mutex);
> - gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
> - mutex_unlock(&sdp->sd_statfs_mutex);
> -
> spin_lock(&sdp->sd_statfs_spin);
> + gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
You can't do gfs2_trans_add_bh under a spinlock, but there is no reason
why you can't just reverse the order of these two statements to fix it,
Steve.