From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19499 invoked by alias); 24 Feb 2009 17:19:03 -0000 Received: (qmail 19493 invoked by alias); 24 Feb 2009 17:19:03 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: cluster: RHEL4 - gfs: don't cancel glocks when writing to hidden file To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL4 X-Git-Reftype: branch X-Git-Oldrev: ef0ddc8d5a80f38b92939a5f403ed444b10015d4 X-Git-Newrev: 5a6349be0bdba75d2b1cc90e5c5861d2661a6304 From: David Teigland Message-Id: <20090224171837.4F1891201E2@lists.fedorahosted.org> Date: Tue, 24 Feb 2009 17:19:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00556.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5a6349be0bdba75d2b1cc90e5c5861d2661a6304 Commit: 5a6349be0bdba75d2b1cc90e5c5861d2661a6304 Parent: ef0ddc8d5a80f38b92939a5f403ed444b10015d4 Author: David Teigland AuthorDate: Tue Feb 24 09:33:52 2009 -0600 Committer: David Teigland CommitterDate: Tue Feb 24 09:33:52 2009 -0600 gfs: don't cancel glocks when writing to hidden file bz 487026 bz 438268 (RHEL5 original) When glock.c sees the PRIORITY flag, it cancels any outstanding glocks prior to doing the lock request. lock_dlm also uses the PRIORITY flag to give give granting priority to the lock in the dlm. Both of these are necessary when the PRIORITY glock is used for recovery, but only the second is wanted (neither is really needed) when writing to a hidden file. A new GL_NOCANCEL_OTHER flag, combined with PRIORITY, is used to tell glock.c to not do the cancels. Signed-off-by: David Teigland --- gfs-kernel/src/gfs/glock.c | 3 ++- gfs-kernel/src/gfs/glock.h | 1 + gfs-kernel/src/gfs/ioctl.c | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gfs-kernel/src/gfs/glock.c b/gfs-kernel/src/gfs/glock.c index 1014ea2..06cfaba 100644 --- a/gfs-kernel/src/gfs/glock.c +++ b/gfs-kernel/src/gfs/glock.c @@ -1326,7 +1326,8 @@ glock_wait_internal(struct gfs_holder *gh) spin_unlock(&gl->gl_spin); } - if (gh->gh_flags & LM_FLAG_PRIORITY) + if ((gh->gh_flags & LM_FLAG_PRIORITY) && + !(gh->gh_flags & GL_NOCANCEL_OTHER)) do_cancels(gh); wait_for_completion(&gh->gh_wait); diff --git a/gfs-kernel/src/gfs/glock.h b/gfs-kernel/src/gfs/glock.h index e7b2325..4fa4d3f 100644 --- a/gfs-kernel/src/gfs/glock.h +++ b/gfs-kernel/src/gfs/glock.h @@ -33,6 +33,7 @@ #define GL_NOCACHE (0x00000400) /* Release glock when done, don't cache */ #define GL_SYNC (0x00000800) /* Sync to disk when no more holders */ #define GL_NOCANCEL (0x00001000) /* Don't ever cancel this request */ +#define GL_NOCANCEL_OTHER (0x00002000) /* Don't cancel other locks for this */ #define GLR_TRYFAILED (13) #define GLR_CANCELED (14) diff --git a/gfs-kernel/src/gfs/ioctl.c b/gfs-kernel/src/gfs/ioctl.c index c5f0d2f..d73926a 100644 --- a/gfs-kernel/src/gfs/ioctl.c +++ b/gfs-kernel/src/gfs/ioctl.c @@ -1209,7 +1209,8 @@ gi_do_hfile_write(struct gfs_sbd *sdp, struct gfs_ioctl *gi) gfs_write_calc_reserv(ip, gi->gi_size, &data_blocks, &ind_blocks); error = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, - LM_FLAG_PRIORITY | GL_SYNC, &i_gh); + LM_FLAG_PRIORITY | GL_SYNC | GL_NOCANCEL_OTHER, + &i_gh); if (error) return error;