mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: Re: warn on lookup_one_length/vfs_quota_on_mount
Date: Thu, 12 Nov 2009 17:20:26 +0100	[thread overview]
Message-ID: <20091112162026.GJ14528@duck.suse.cz> (raw)
In-Reply-To: <20091112124238.GH14528@duck.suse.cz>

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

  Hello,

On Thu 12-11-09 13:42:38, Jan Kara wrote:
> On Thu 12-11-09 08:29:06, Bastien ROUCARIES wrote:
> > I get the following warm on my reiserfs disk with quota enabled at
> > boot (each boot) see
> > http://www.kerneloops.org/raw.php?rawid=937752&msgid=
> > *lookup_one_len
> > ? lookup_one_len
> > ? lookup_one_len
> > ? warn_slowpath_common
> > ? lookup_one_len
> > ? vfs_quota_on_mount
> > ? finish_unfinished
> > ? reiserfs_remount
> > ? __filemap_fdatawrite_range
> > ? do_remount_sb
> > ? do_mount
> > ? sys_mount
> > ? system_call_fastpath
> > 
> > But it seems a generic bug in the quota layer due to:
> > http://www.kerneloops.org/oops.php?number=799645
> > http://www.kerneloops.org/oops.php?number=700122
>   OK, this shouldn't lead to any real bug (since we look them up during
> filesystem mount or remount read-write when noone can mess with the root
> directory). But it's probably good to silence the warning by proper locking
> anyway. I'll do it. Thanks for the report!
  Attached patch fixes the warning for me.

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

[-- Attachment #2: 0001-quota-Fix-WARN_ON-in-lookup_one_len.patch --]
[-- Type: text/x-patch, Size: 1213 bytes --]

>From 1422c40784979ee85aa0f74655fc6e627ddbb1c0 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Thu, 12 Nov 2009 15:42:08 +0100
Subject: [PATCH] quota: Fix WARN_ON in lookup_one_len

We should hold i_mutex when looking up quota files for journaled quotas,
otherwise a WARN_ON in lookup_one_len triggers. The fact that we didn't
hold i_mutex previously probably could not lead to a real bug since the
filesystem is just being mounted / remounted read-write and thus the
root directory cannot change anyway but it's definitely cleaner with
i_mutex.

Reported-by: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/quota/dquot.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 39b49c4..aa97df1 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2233,7 +2233,9 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
 	struct dentry *dentry;
 	int error;
 
+	mutex_lock(&sb->s_root->d_inode->i_mutex);
 	dentry = lookup_one_len(qf_name, sb->s_root, strlen(qf_name));
+	mutex_unlock(&sb->s_root->d_inode->i_mutex);
 	if (IS_ERR(dentry))
 		return PTR_ERR(dentry);
 
-- 
1.6.0.2


  reply	other threads:[~2009-11-12 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12  7:29 Bastien ROUCARIES
2009-11-12 12:42 ` Jan Kara
2009-11-12 16:20   ` Jan Kara [this message]
2009-12-10  8:49     ` Bastien ROUCARIES

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=20091112162026.GJ14528@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roucaries.bastien@gmail.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 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®