mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Arjan van de Ven <arjan@linux.intel.com>
Cc: Valdis.Kletnieks@vt.edu, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: 2.6.17-rc5-mm3-lockdep - locking error in quotaon
Date: Mon, 5 Jun 2006 22:06:52 +0200	[thread overview]
Message-ID: <20060605200652.GC24342@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <1149537156.3111.123.camel@laptopd505.fenrus.org>

> 
> > following confuses the code (and I agree that it's kind of ugly from
> > quota code to do that):
> >   i_mutex of inode containing quota file is acquired after all other
> > quota locks. i_mutex of all other inodes is acquired before quota locks.
> > Quota code makes sure (by resetting inode operations and setting special
> > flag on inode) that noone tries to enter quota code while holding
> > i_mutex on a quota file...
> 
> can you point this out in a bit more detail, eg where exactly is this
> happening? I think it is in this bit
>        /* As we bypass the pagecache we must now flush the inode so that
>          * we see all the changes from userspace... */
>         write_inode_now(inode, 1);
>         /* And now flush the block cache so that kernel sees the changes
> */
>         invalidate_bdev(sb->s_bdev, 0);
>         mutex_lock(&inode->i_mutex);
>         mutex_lock(&dqopt->dqonoff_mutex);
>         if (sb_has_quota_enabled(sb, type)) {
>                 error = -EBUSY;
>                 goto out_lock;
> 
> but that doesn't quite match your description...
  This piece of code is there just because we avoid page cache when
doing quota writes. That is a different story and should cause problems
with your lock checker.
  Standard way of running quota is:
- get i_mutex for data_inode
- write some data to data_inode
  - requires allocation -> calls DQUOT_ALLOC_SPACE
  - DQUOT_ALLOC_SPACE acquires some quota locks, decides it wants to
    write out quota structure (e.g. because we are journaling quota and
    must preserve quota integrity)
    - acquires dqio_sem, calls filesystem specific quota writing
      function - e.g. ext3_quota_write()
    - this function acquires i_mutex for quota file

I think this is the type of circle your checker has found.

								Honza

  reply	other threads:[~2006-06-05 20:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05 17:00 Valdis.Kletnieks
2006-06-05 17:25 ` Arjan van de Ven
2006-06-05 17:35   ` Jan Kara
2006-06-05 19:20   ` Valdis.Kletnieks
2006-06-05 19:35     ` Jan Kara
2006-06-05 19:52       ` Arjan van de Ven
2006-06-05 20:06         ` Jan Kara [this message]
2006-06-05 20:15           ` Ingo Molnar
2006-06-05 20:26           ` Arjan van de Ven
2006-06-06  2:22             ` Valdis.Kletnieks
2006-06-06  8:33             ` Ingo Molnar

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=20060605200652.GC24342@atrey.karlin.mff.cuni.cz \
    --to=jack@suse.cz \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@osdl.org \
    --cc=arjan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®