Re: [NFS] Locking patches (generic & nfs)

Trond Myklebust (trond.myklebust@fys.uio.no)
Tue, 23 Jul 2002 17:27:38 +0200


--------------Boundary-00=_2AKPHME3BAIGNDN4KA07
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: 8bit

On Tuesday 23 July 2002 17:06, Olaf Kirch wrote:

> But as it is today, all blocked locks get inserted at the end of the
> list because time_before_eq does a signed comparison! With the unpatched
> code, when you have a blocked lock, and the conflicting lock is removed,
> lockd will never send out a GRANTED_MSG. Because the blocked lock is at the
> end of the list, and never picked up.

Fair enough: I see the bug now.

So why could we not do something like the following instead? This just ensures
that we always leave the NLM_NEVER stuff at the end of the list which should
suffice to keep nlmsvc_retry_blocked() happy.

Cheers,
Trond

--------------Boundary-00=_2AKPHME3BAIGNDN4KA07
Content-Type: text/plain;
charset="iso-8859-15";
name="fix_svclock.dif"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="fix_svclock.dif"

--- linux/fs/lockd/svclock.c.orig Tue Feb 5 08:52:37 2002
+++ linux/fs/lockd/svclock.c Tue Jul 23 17:15:12 2002
@@ -64,7 +64,7 @@
if (when != NLM_NEVER) {
if ((when += jiffies) == NLM_NEVER)
when ++;
- while ((b = *bp) && time_before_eq(b->b_when,when))
+ while ((b = *bp) && time_before_eq(b->b_when,when) && b->b_when != NLM_NEVER)
bp = &b->b_next;
} else
while ((b = *bp))

--------------Boundary-00=_2AKPHME3BAIGNDN4KA07--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/