From: David Teigland <teigland@redhat.com> Date: Wed, 8 Sep 2010 18:47:38 -0400 Subject: [fs] dlm: no node callback when try 1cb lock req fails Message-id: <20100908184738.GA14358@redhat.com> Patchwork-id: 28181 O-Subject: [RHEL5.6 PATCH] dlm: Don't send callback to node making lock request when "try 1cb" fails Bugzilla: 504188 RH-Acked-by: Steven Whitehouse <swhiteho@redhat.com> RH-Acked-by: Robert S Peterson <rpeterso@redhat.com> bz 504188 dlm: Don't send callback to node making lock request when "try 1cb" fails upstream: queued for 2.6.37 When converting a lock, an lkb is in the granted state and also being used to request a new state. In the case that the conversion was a "try 1cb" type which has failed, and if the new state was incompatible with the old state, a callback was being generated to the requesting node. This is incorrect as callbacks should only be sent to all the other nodes holding blocking locks. The requesting node should receive the normal (failed) response to its "try 1cb" conversion request only. This was discovered while debugging a performance problem on GFS2, however this fix also speeds up GFS as well. In the GFS2 case the performance gain is over 10x for cases of write activity to an inode whose glock is cached on another, idle (wrt that glock) node. (comment added, dct) Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Tested-by: Abhijith Das <adas@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com> diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index cd2b2cf..edea42b 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -1807,6 +1807,9 @@ static void send_bast_queue(struct dlm_rsb *r, struct list_head *head, struct dlm_lkb *gr; list_for_each_entry(gr, head, lkb_statequeue) { + /* skip self when sending basts to convertqueue */ + if (gr == lkb) + continue; if (gr->lkb_bastaddr && modes_require_bast(gr, lkb)) { queue_bast(r, gr, lkb->lkb_rqmode); gr->lkb_highbast = lkb->lkb_rqmode;