From: Jan Kara <jack@suse.cz>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
Joel Becker <joel.becker@oracle.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [WTFoTW] ->quota_on() deadlocks
Date: Fri, 2 Jul 2010 22:13:58 +0200 [thread overview]
Message-ID: <20100702201357.GC3583@quack.suse.cz> (raw)
In-Reply-To: <20100701185629.GJ31073@ZenIV.linux.org.uk>
On Thu 01-07-10 19:56:29, Al Viro wrote:
> All quotactl callbacks are done with s_umount held shared.
> Fine, but ->quota_on() will do kern_path() and _that_ can try to
> grab the same thing exclusive - suppose we pass a pathname that
> walks into autofs and triggers mounting of the same fs (at a different
> mountpoint, that is). That'll end up calling sget(), finding our
> superblock and trying to grab s_umount on it. mount(8) sits
> uninterruptibly sleeping in mount(2), kern_path() waits for it
> to complete and that's not going to happen until the caller of
> kern_path() (do_quotactl(), ultimately) finishes.
>
> Obvious solution is b0rken - we _can't_ take the call of
> kern_path() to a point prior to getting (and locking) the superblock.
> Why? Because ocfs2 ignores the pathname argument, so failing on
> bogus pathnames will blow the userland API compatibility.
>
> Other alternatives are also not particulary pleasant since
> we need s_umount at some point there - we want some exclusion with
> remounting.
>
> Ideas?
Not now :(. I'm on vacation this and next week. I'll look into the bug when
I return.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
prev parent reply other threads:[~2010-07-02 20:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 18:56 [WTFoTW] ->quota_on() deadlocks Al Viro
2010-07-01 22:38 ` Christoph Hellwig
2010-07-02 10:25 ` Christoph Hellwig
2010-07-02 20:13 ` Jan Kara [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=20100702201357.GC3583@quack.suse.cz \
--to=jack@suse.cz \
--cc=hch@lst.de \
--cc=joel.becker@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).