From: "Vladimir B. Savkin" <master@sectorb.msk.ru>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.9-rc2 hangs in posix_locks_deadlock
Date: Sat, 30 Oct 2004 14:39:34 +0400 [thread overview]
Message-ID: <20041030103934.GA25671@tentacle.sectorb.msk.ru> (raw)
In-Reply-To: <1095634303.7860.122.camel@lade.trondhjem.org>
On Sun, Sep 19, 2004 at 03:51:43PM -0700, Trond Myklebust wrote:
> Hmm... It appears that it is indeed possible for both leases and flocks
> to be on the global "blocked_list", so the appended check is *not*
> redundant.
> Since flocks in particular do not initialize fl_owner, I suspect that
> you might be seeing wierd loops that were previously being avoided due
> to the ->fl_pid checks...
I just noticed that this fix didn't make it into 2.6.9.
> [PATCH] fix posix_locks_deadlock().
>
> "blocked_list" may contain both leases and flock locks. Since the latter in
> particular do not initialize the fl_owner field, we have to beware not to
> call posix_same_owner() on them.
>
> Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
> ---
> locks.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> Index: linux-2.6.9-rc2-up/fs/locks.c
> ===================================================================
> --- linux-2.6.9-rc2-up.orig/fs/locks.c 2004-09-19 13:55:33.680258334 -0700
> +++ linux-2.6.9-rc2-up/fs/locks.c 2004-09-19 15:37:32.595634679 -0700
> @@ -634,14 +634,13 @@
> int posix_locks_deadlock(struct file_lock *caller_fl,
> struct file_lock *block_fl)
> {
> - struct list_head *tmp;
> + struct file_lock *fl;
>
> next_task:
> if (posix_same_owner(caller_fl, block_fl))
> return 1;
> - list_for_each(tmp, &blocked_list) {
> - struct file_lock *fl = list_entry(tmp, struct file_lock, fl_link);
> - if (posix_same_owner(fl, block_fl)) {
> + list_for_each_entry(fl, &blocked_list, fl_link) {
> + if (IS_POSIX(fl) && posix_same_owner(fl, block_fl)) {
> fl = fl->fl_next;
> block_fl = fl;
> goto next_task;
~
:wq
With best regards,
Vladimir Savkin.
prev parent reply other threads:[~2004-10-30 10:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-19 16:03 Vladimir B. Savkin
2004-09-19 20:05 ` Vladimir B. Savkin
2004-09-19 20:32 ` Trond Myklebust
2004-09-19 20:36 ` Vladimir B. Savkin
2004-09-19 22:51 ` Trond Myklebust
2004-09-20 11:47 ` Vladimir B. Savkin
2004-10-30 10:39 ` Vladimir B. Savkin [this message]
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=20041030103934.GA25671@tentacle.sectorb.msk.ru \
--to=master@sectorb.msk.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
/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
all inboxes | Powered by JetHome®