All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	reiserfs-devel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Al Viro <viro@ZenIV.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
	"Ted Ts'o" <tytso@mit.edu>, Joel Becker <joel.becker@oracle.com>
Subject: Re: [PATCH] quota: Fix deadlock during path resolution
Date: Thu, 16 Sep 2010 00:52:08 +0200	[thread overview]
Message-ID: <20100915225208.GA1490@lst.de> (raw)
In-Reply-To: <1284586791-8245-1-git-send-email-jack@suse.cz>

On Wed, Sep 15, 2010 at 11:39:51PM +0200, Jan Kara wrote:
> As Al Viro pointed out path resolution during Q_QUOTAON calls to quotactl
> is prone to deadlocks. We hold s_umount semaphore for reading during the
> path resolution and resolution itself may need to acquire the semaphore
> for writing when e. g. autofs mountpoint is passed.
> 
> Solve the problem by performing the resolution before we get hold of the
> superblock (and thus s_umount semaphore). The whole thing is complicated
> by the fact that some filesystems (OCFS2) ignore the path argument. So to
> distinguish between filesystem which want the path and which do not we
> introduce new .quota_on_meta callback which does not get the path. OCFS2
> then uses this callback instead of old .quota_on.

FYI I have a patch that switches ocfs to share the quota_on method with
XFS which behaves the same, and consolidate the quota_off method for all
filesystems.  I think that's better than adding yet another method.

I'll rebase it and send it out soon.


WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	reiserfs-devel@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	Al Viro <viro@ZenIV.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
	Ted Ts'o <tytso@mit.edu>, Joel Becker <joel.becker@oracle.com>
Subject: [Ocfs2-devel] [PATCH] quota: Fix deadlock during path resolution
Date: Thu, 16 Sep 2010 00:52:08 +0200	[thread overview]
Message-ID: <20100915225208.GA1490@lst.de> (raw)
In-Reply-To: <1284586791-8245-1-git-send-email-jack@suse.cz>

On Wed, Sep 15, 2010 at 11:39:51PM +0200, Jan Kara wrote:
> As Al Viro pointed out path resolution during Q_QUOTAON calls to quotactl
> is prone to deadlocks. We hold s_umount semaphore for reading during the
> path resolution and resolution itself may need to acquire the semaphore
> for writing when e. g. autofs mountpoint is passed.
> 
> Solve the problem by performing the resolution before we get hold of the
> superblock (and thus s_umount semaphore). The whole thing is complicated
> by the fact that some filesystems (OCFS2) ignore the path argument. So to
> distinguish between filesystem which want the path and which do not we
> introduce new .quota_on_meta callback which does not get the path. OCFS2
> then uses this callback instead of old .quota_on.

FYI I have a patch that switches ocfs to share the quota_on method with
XFS which behaves the same, and consolidate the quota_off method for all
filesystems.  I think that's better than adding yet another method.

I'll rebase it and send it out soon.

  reply	other threads:[~2010-09-15 22:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15 21:39 [PATCH] quota: Fix deadlock during path resolution Jan Kara
2010-09-15 21:39 ` [Ocfs2-devel] " Jan Kara
2010-09-15 22:52 ` Christoph Hellwig [this message]
2010-09-15 22:52   ` Christoph Hellwig
2010-09-16  9:55   ` Jan Kara
2010-09-16  9:55     ` [Ocfs2-devel] " Jan Kara
2011-01-07 21:59     ` Ted Ts'o
2011-01-07 21:59       ` [Ocfs2-devel] " Ted Ts'o
2011-01-08  7:47       ` Christoph Hellwig
2011-01-08  7:47         ` [Ocfs2-devel] " Christoph Hellwig
2011-01-12 18:06       ` Jan Kara
2011-01-12 18:06         ` [Ocfs2-devel] " Jan Kara

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=20100915225208.GA1490@lst.de \
    --to=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=joel.becker@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@ZenIV.linux.org.uk \
    /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.