All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Evgeniy Dushistov <dushistov@mail.ru>,
	Ian Campbell <ian.campbell@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Fabian Frederick <fabf@skynet.be>, Jan Kara <jack@suse.cz>,
	Alexey Khoroshilov <khoroshilov@ispras.ru>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH 1/2 linux-next] Revert "ufs: fix deadlocks introduced by sb mutex merge"
Date: Thu, 4 Jun 2015 06:01:24 +0100	[thread overview]
Message-ID: <20150604050123.GL7232@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20150527145735.e3d1913bc66426038d53be32@linux-foundation.org>

On Wed, May 27, 2015 at 02:57:35PM -0700, Andrew Morton wrote:
> On Wed, 27 May 2015 21:15:30 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> 
> > This reverts commit 9ef7db7f38d0
> > ("ufs: fix deadlocks introduced by sb mutex merge")
> > That patch tried to solve
> >     Commit 0244756edc4b98c
> >     ("ufs: sb mutex merge + mutex_destroy")
> > which is itself partially reverted due to multiple deadlocks
> 
> This is all very vague.  The changelogs are missing any description of
> the deadlocks: how they are triggered, why they occur.  And there's no
> description of how the patches fix these deadlocks.  And as we're
> reverting a bunch of things one wonders whether the problems which the
> now-reverted patches fixed are being reintroduced.
> 
> Has anyone (Ian?) confirmed that the fs works OK with these patches?

Folks, how about we figure out what's really being protected by that
mutex?  IIRC, the main irregularity about ufs is the need to deal with
growing the partial final block - unlike e.g ext2, ufs has differently-sized
blocks and fragments.  Basically, it's tail-packing - short files have
the last used direct pointer refer to a group of adjacent fragments that
doesn't have to be block-aligned or fill the entire block.  They can't
cross the disk block boundary and write might have to reallocate the partial
block.

So we need
	* per-page exclusion for reallocation time (normal page locks are
doing that)
	* per-fs exclusion for block and fragment allocations (->s_lock?)
	* per-fs exclusion for inode allocations (->s_lock?)
	* per-inode exclusion for mapping changes (a-la ext2 truncate_mutex)
	* per-directory exclusion for contents access (->i_mutex gives that)

Looks like we ought to add ->truncate_mutex and shove lock_ufs() calls
all way down into balloc.c (and ialloc.c for inode allocations)...

       reply	other threads:[~2015-06-04  5:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1432754131-27425-1-git-send-email-fabf@skynet.be>
     [not found] ` <20150527145735.e3d1913bc66426038d53be32@linux-foundation.org>
2015-06-04  5:01   ` Al Viro [this message]
2015-06-04 22:22     ` [PATCH 1/2 linux-next] Revert "ufs: fix deadlocks introduced by sb mutex merge" Al Viro
2015-06-04 22:22     ` Al Viro
2015-06-05 16:27     ` Fabian Frederick
2015-06-05 18:50       ` Al Viro
2015-06-05 22:03         ` Al Viro
2015-06-05 22:03         ` Al Viro
2015-06-17  8:57           ` Jan Kara
2015-06-17  8:57           ` Jan Kara
2015-06-17 20:31             ` Al Viro
2015-06-17 20:31             ` Al Viro
2015-06-19 23:07               ` Al Viro
2015-06-19 23:07               ` Al Viro
2015-06-23 16:46                 ` Jan Kara
2015-06-23 21:56                   ` Al Viro
2015-06-23 21:56                   ` Al Viro
2015-06-23 16:46                 ` Jan Kara
2015-06-06  8:04         ` Fabian Frederick

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=20150604050123.GL7232@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=akpm@linux-foundation.org \
    --cc=dushistov@mail.ru \
    --cc=fabf@skynet.be \
    --cc=ian.campbell@citrix.com \
    --cc=jack@suse.cz \
    --cc=khoroshilov@ispras.ru \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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.