linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Allison <jra@samba.org>
To: Stuart_Hayes@Dell.com
Cc: jra@samba.org, michael@wil.cx, linux-fsdevel@vger.kernel.org
Subject: Re: posix_lock_deadlocks() hang
Date: Tue, 14 Sep 2004 12:28:14 -0700	[thread overview]
Message-ID: <20040914192814.GE16151@jeremy1> (raw)
In-Reply-To: <7A8F92187EF7A249BF847F1BF4903C040AFBF3@ausx2kmpc103.aus.amer.dell.com>

On Tue, Sep 14, 2004 at 02:23:29PM -0500, Stuart_Hayes@Dell.com wrote:
> Jeremy Allison wrote:
> > On Mon, Sep 13, 2004 at 03:25:41PM -0500, Stuart_Hayes@Dell.com wrote:
> >> 
> >> I am seeing the kernel get stuck in an endless loop in
> >> posix_locks_deadlock() checking for deadlocks.
> >> 
> >> It appears that samba (smbd) is getting both flocks and posix locks.
> >> Since flock_lock_file() isn't checking for potential deadlocks before
> >> adding lock requests to the blocked_list, we end up with (what
> >> appears to be) a circular dependency between a posix lock and an
> >> flock in blocked_list.
> > 
> > I'm not aware that we obtain any locks with flock. We only use fcntl
> > (POSIX) locks. I just grepped the code so I'm quite sure :-). 
> > 
> > Jeremy.
> 
> I haven't specifically traced your application, but, while debugging the
> locking code, I definitely saw smbd requesting both flocks and posix
> locks.
> 
> Also, looking at Samba version 3.0.6, from Red Hat Enterprise Linux, and
> I see
> source/smbd/open.c:     if (kernel_mode) flock(fsp->fd,  kernel_mode);
> among other grep matches.
> 
> I just checked 3.0.7, and it seems to do the same thing.

Yes, that's only if #if HAVE_KERNEL_SHARE_MODES is defined,
which is not turned on by default. That's only done if someone
sets it by hand (it's not autoconf tested). It's also not a
standard flock (to lock files) but a request for a share mode
in the kernel.

Did you turn this on ?

Jeremy.

  reply	other threads:[~2004-09-14 19:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-14 19:23 posix_lock_deadlocks() hang Stuart_Hayes
2004-09-14 19:28 ` Jeremy Allison [this message]
2004-09-14 19:30   ` Jeremy Allison
  -- strict thread matches above, loose matches on Subject: below --
2004-09-17 16:21 Stuart_Hayes
2004-09-14 14:43 Stuart_Hayes
2004-09-13 20:25 Stuart_Hayes
2004-09-14  0:55 ` Matthew Wilcox
2004-09-14 19:09 ` Jeremy Allison
2004-09-14 23:23   ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040914192814.GE16151@jeremy1 \
    --to=jra@samba.org \
    --cc=Stuart_Hayes@Dell.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=michael@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).