RE: flock/posix lock question

From: Stuart_Hayes
Date: Fri Sep 10 2004 - 16:43:54 EST



Hello--

This question regards file locks and code in fs/locks.c.

I am seeing the kernel get stuck in posix_locks_deadlock() checking for
deadlocks. It appears that samba (smbd) is getting both an flock and a
posix lock for the same file, which results in a circular dependency in
the blocked_list... and posix_locks_deadlock() is getting stuck in that
circle.
The circular dependency gets into the blocked_list because deadlock
situations aren't checked for when inserting flock requests into the
blocked_list.

Since flocks aren't supposed to do any deadlock checking, it seems like
the
right solution to this would be to modify posix_locks_deadlock() to only

check for deadlock situations with other posix locks and lock requests,
and
ignore flocks. Of course, samba should also probably be fixed so that
it
doesn't do that, too... but it shouldn't be able to cause a kernel hang
by
doing so.

Does this sound correct? Am I missing something?

(I am seeing this on a RHEL3 update 3 (2.4.21-20) kernel.)

Thanks!
Stuart




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