All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possible deadlock with ->writepaged version of flush_dirty_buffers() and 2.4.0
Date: Thu, 11 Jan 2001 10:43:04 -0500	[thread overview]
Message-ID: <517420000.979227784@tiny> (raw)
In-Reply-To: <Pine.LNX.4.21.0101101742500.8441-100000@freak.distro.conectiva>



On Wednesday, January 10, 2001 05:56:09 PM -0200 Marcelo Tosatti
<marcelo@conectiva.com.br> wrote:

> 
> Hi Chris,
> 
> It seems there is a possible deadlock condition with your patch which
> changes flush_dirty_buffers() to use ->writepage (something which we
> _definately_ want for 2.5). Take a look:
> 
Yes, good catch.

> 
> mark_buffer_dirty->balance_dirty->wakeup_bdflush->flush_dirty_buffers->
> writepage->block_write_full_page->__block_write_full_page->get_block->
> ext2_get_block->ext2_alloc_branch->
> 
>	 ext2_alloc_block->ext2_new_block->lock_super
>	 or 
>	 getblk()->lock_super
> 
> 
> I dont see any reason why this deadlock could'nt happen in practice now.
> 
It won't happen until someone other than fs/buffer.c starts marking ext2
pages dirty.  The normal file write path will make sure that any dirty
buffers are mapped, so the ext2_get_block code is never run.

> If I'm right, it will pretty nasty to fix this. One possible solution is
> to _never_ call mark_buffer_dirty() with the superblock lock held (ext2
> has a lot of places likes this right now)
> 

This is probably the best solution, since it is a good idea regardless of
my patch.

-chris
 


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

      reply	other threads:[~2001-01-11 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10 19:56 Possible deadlock with ->writepaged version of flush_dirty_buffers() and 2.4.0 Marcelo Tosatti
2001-01-11 15:43 ` Chris Mason [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=517420000.979227784@tiny \
    --to=mason@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.