All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Jan Kara <jack@suse.cz>, Valerie Aurora <val@vaaconsulting.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	dm-devel@redhat.com,
	Christopher Chaltain <christopher.chaltain@canonical.com>,
	esandeen@redhat.com, Surbhi Palande <csurbhi@gmail.com>
Subject: Re: [PATCH] deadlock with suspend and quotas
Date: Tue, 29 Nov 2011 12:11:36 +0100	[thread overview]
Message-ID: <20111129111136.GC5635@quack.suse.cz> (raw)
In-Reply-To: <Pine.LNX.4.64.1111290556270.12274@hs20-bc2-1.build.redhat.com>

On Tue 29-11-11 06:06:21, Mikulas Patocka wrote:
> On Tue 29-11-11 11:19:01, Jan Kara wrote:
> >   Hi,
> > 
> > On Mon 28-11-11 18:32:18, Mikulas Patocka wrote:
> > > > Hi
> > > > 
> > > > Where can I get that patch set?
> > > > 
> > > > We are experiencing other similar deadlocks on RHEL-6, caused by sync or 
> > > > background writeback (these code paths take s_umount and wait trying to do 
> > > > I/O), but I wasn't able to reproduce these deadlocks on upstream kernel? 
> > > > Are there other known deadlock possibilities?
> > > 
> > > I found some patch named "[RFC PATCH 1/3] VFS: Fix s_umount thaw/write 
> > > deadlock" (I couldn't find the next two parts of the patch in the 
> > > archives). And the patch looks wrong:
> >   Yes, that seems to be the series. I generally agree with you that the
> > last iteration still had some problems and some changes were requested.
> > That's why it's not merged yet after all...
> > 
> > > - down_read_trylock(&sb->s_umount) doesn't fix anything. The lock is not 
> > > held when the filesystem is frozen and it is taken for write when thawing. 
> > > Consequently, any task can succeed with down_read_trylock(&sb->s_umount) 
> > > on a frozen filesystem and if this tasks attempts to do an I/O that is 
> > > waiting for thaw, it may still deadlock.
> >   Agreed.
> > 
> > > - skipping sync on frozen filesystem violates sync semantics. 
> > > Applications, such as databases, assume that when sync finishes, data were 
> > > written to stable storage. If we skip sync when the filesystem is frozen, 
> > > we can cause data corruption in these applications (if the system crashes 
> > > after we skipped a sync).
> >   Here I don't agree. Filesystem must guarantee there are no dirty data on
> > a frozen filesystem.
> 
> This is technically impossible to achieve on ext2, fat or other 
> non-transactional filesystems. These filesystems have no locks around code 
> paths that set data or inodes dirty. And you still need working sync for 
> ext2. So the best thing to do in sync is to wait until the filesystem is 
> unfrozen.
  Then suspend is effectively unsupported on the filesystem and should
return EOPNOTSUPP? At least that's what I'd expect...

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2011-11-29 11:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25 20:25 [PATCH] deadlock with suspend and quotas Mikulas Patocka
2011-11-28 15:04 ` Jan Kara
2011-11-28 21:00   ` Valerie Aurora
2011-11-28 21:14     ` Mikulas Patocka
2011-11-28 23:32       ` Mikulas Patocka
2011-11-28 23:32         ` Mikulas Patocka
2011-11-29 10:19         ` Jan Kara
2011-11-29 10:21           ` Jan Kara
2011-11-29 11:06             ` Mikulas Patocka
2011-11-29 11:11               ` Jan Kara [this message]
2011-11-29 12:54                 ` Mikulas Patocka
2011-11-29 13:09                   ` Jan Kara
2011-11-29 13:18                     ` [dm-devel] " Alasdair G Kergon
2011-11-29 13:32                       ` Jan Kara
2011-11-29 16:33                         ` Eric Sandeen
2011-11-30  6:52                         ` Mikulas Patocka
2011-11-30 11:16                           ` Jan Kara
2011-11-30 12:14                             ` Mikulas Patocka
2011-11-30 13:05                               ` Alasdair G Kergon
2011-11-30 16:53                                 ` Jan Kara
2011-11-30 17:09                                   ` Mikulas Patocka
2011-11-30 13:33           ` Alasdair G Kergon
2011-11-30 13:48             ` Alasdair G Kergon
2011-11-30 16:36               ` Mikulas Patocka
2011-11-30 16:34             ` Mikulas Patocka
2011-12-01  0:34               ` Jan Kara
2011-11-30 14:09           ` Alasdair G Kergon
2011-11-30 16:53             ` Mikulas Patocka
2011-12-01  0:03               ` Jan Kara
2011-11-30 17:03             ` Mikulas Patocka
2011-11-29 20:00     ` Kamal Mostafa
2012-01-03  3:30 ` Al Viro
2012-01-03 18:22   ` Mikulas Patocka
2012-01-03 18:35     ` Mikulas Patocka

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=20111129111136.GC5635@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=christopher.chaltain@canonical.com \
    --cc=csurbhi@gmail.com \
    --cc=dm-devel@redhat.com \
    --cc=esandeen@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=val@vaaconsulting.com \
    /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.