From: Abhijith Das Date: Fri, 21 Jul 2006 06:03:21 +0000 (-0400) Subject: [GFS2] gfs2_set_flags double locking patch X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=52f341cf75d2da84811127582616984eb0602360;p=linux-beck.git [GFS2] gfs2_set_flags double locking patch traced the "umount hang due to spurious glock" issue that I was having with gfs2meta. It's in the do_gfs2_set_flags function, which does a gfs2_holder_init as well as a gfs2_glock_nq_init (increases ref count by 2 instead of 1). Signed-off-by: Abhijith Das Signed-off-by: Steven Whitehouse --- diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c index 26f1d3249b0f..6764ca69bc52 100644 --- a/fs/gfs2/ops_file.c +++ b/fs/gfs2/ops_file.c @@ -608,12 +608,9 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) int error; u32 new_flags, flags; - gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); - if (error) { - gfs2_holder_uninit(&gh); + if (error) return error; - } flags = ip->i_di.di_flags; new_flags = (flags & ~mask) | (reqflags & mask);