From: Al Viro <viro@ZenIV.linux.org.uk>
To: linux-fsdevel@vger.kernel.org
Cc: Jan Kara <jack@suse.cz>, Joel Becker <joel.becker@oracle.com>,
Christoph Hellwig <hch@lst.de>
Subject: [WTFoTW] ->quota_on() deadlocks
Date: Thu, 1 Jul 2010 19:56:29 +0100 [thread overview]
Message-ID: <20100701185629.GJ31073@ZenIV.linux.org.uk> (raw)
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?
next reply other threads:[~2010-07-01 18:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-01 18:56 Al Viro [this message]
2010-07-01 22:38 ` [WTFoTW] ->quota_on() deadlocks Christoph Hellwig
2010-07-02 10:25 ` Christoph Hellwig
2010-07-02 20:13 ` 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=20100701185629.GJ31073@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=joel.becker@oracle.com \
--cc=linux-fsdevel@vger.kernel.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.