mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Lukas Hejtmanek <xhejtman@mail.muni.cz>
Cc: Andrew Morton <akpm@digeo.com>, linux-kernel@vger.kernel.org
Subject: Re: 2.5.54 - quota support
Date: Tue, 7 Jan 2003 17:40:28 +0100	[thread overview]
Message-ID: <20030107164028.GC6719@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20030106151908.GA640@mail.muni.cz>

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

> On Mon, Jan 06, 2003 at 03:48:43PM +0100, Jan Kara wrote:
> >   I seems like quotaon (or better quotactl()) waits on some lock
> > forever... I'll try to reproduce it but in the mean time can you print
> > list of processes, write down a few addresses from the top of the stack
> > of quotaon and try to match it in the system.map to function in which
> > is process stuck?
> 
> according to strace quotaon freezes at
> quotactl(0xff800002, "/dev/hda1", 2
> 
> call trace is: (sysrq-t)
> vfs_permission
> __rwsem_do_wake
> rwsem_down_read_failed
> module_put
> dqinit_needed
> vfs_quota_off
> resolve_dev
> d_free
> deny_write_access
> check_quotactl_valid
> d_free
> scheduling_functions_start_here
> do_quotactl
> system_call
> 
> 
> Btw, freeze on quotaon is not regular. After some time that system is up,
> quotaon reports only no such device and terminates.
> 
> so looks like
> 1) freeze on quotactl
> 2) reports no such device
> 
> in both cases not working.
  Reporting 'No such device' was actually bug which was introduced some
time ago but nobody probably noticed it... It was introduce when quota
code was converted from device numbers to 'bdev' structures.
  I also fixed one bug in quotaon() call however I'm not sure wheter it
could cause the freeze. Anyway patch is attached, try it and tell me
about the changes.

							Honza

-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

[-- Attachment #2: quota-2.5.54-1-fix.diff --]
[-- Type: text/plain, Size: 1723 bytes --]

diff -ruNX /home/jack/.kerndiffexclude linux-2.5.54/fs/dquot.c linux-2.5.54-1-lockfix/fs/dquot.c
--- linux-2.5.54/fs/dquot.c	Mon Jan  6 21:54:10 2003
+++ linux-2.5.54-1-lockfix/fs/dquot.c	Mon Jan  6 23:49:43 2003
@@ -1157,6 +1157,7 @@
 	struct quota_info *dqopt = sb_dqopt(sb);
 	struct quota_format_type *fmt = find_quota_format(format_id);
 	int error;
+	unsigned int oldflags;
 
 	if (!fmt)
 		return -ESRCH;
@@ -1181,10 +1182,11 @@
 		error = -EBUSY;
 		goto out_lock;
 	}
+	oldflags = inode->i_flags;
 	dqopt->files[type] = f;
 	error = -EINVAL;
 	if (!fmt->qf_ops->check_quota_file(sb, type))
-		goto out_lock;
+		goto out_file_init;
 	/* We don't want quota on quota files */
 	dquot_drop_nolock(inode);
 	inode->i_flags |= S_NOQUOTA;
@@ -1194,7 +1196,7 @@
 	down(&dqopt->dqio_sem);
 	if ((error = dqopt->ops[type]->read_file_info(sb, type)) < 0) {
 		up(&dqopt->dqio_sem);
-		goto out_lock;
+		goto out_file_init;
 	}
 	up(&dqopt->dqio_sem);
 	set_enable_flags(dqopt, type);
@@ -1204,9 +1206,10 @@
 	up_write(&dqopt->dqoff_sem);
 	return 0;
 
-out_lock:
-	inode->i_flags &= ~S_NOQUOTA;
+out_file_init:
+	inode->i_flags = oldflags;
 	dqopt->files[type] = NULL;
+out_lock:
 	up_write(&dqopt->dqoff_sem);
 out_f:
 	filp_close(f, NULL);
diff -ruNX /home/jack/.kerndiffexclude linux-2.5.54/fs/quota.c linux-2.5.54-1-lockfix/fs/quota.c
--- linux-2.5.54/fs/quota.c	Tue Jan  7 00:47:58 2003
+++ linux-2.5.54-1-lockfix/fs/quota.c	Tue Jan  7 00:49:23 2003
@@ -114,7 +114,11 @@
 	ret = user_path_walk(path, &nd);
 	if (ret)
 		goto out;
-
+	ret = bd_acquire(nd.dentry->d_inode);
+	if (ret) {
+		path_release(&nd);
+		goto out;
+	}
 	bdev = nd.dentry->d_inode->i_bdev;
 	mode = nd.dentry->d_inode->i_mode;
 	path_release(&nd);

  reply	other threads:[~2003-01-07 16:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06  0:38 Lukas Hejtmanek
2003-01-06  1:59 ` Andrew Morton
2003-01-06 10:36   ` Lukas Hejtmanek
2003-01-06 14:48     ` Jan Kara
2003-01-06 15:19       ` Lukas Hejtmanek
2003-01-07 16:40         ` Jan Kara [this message]
2003-01-08  1:21           ` Lukas Hejtmanek
2003-01-08 10:22             ` Miquel van Smoorenburg
2003-01-08 10:56             ` Jan Kara
2003-01-10 19:32             ` Jan Kara
2003-01-12 21:20               ` Lukas Hejtmanek

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=20030107164028.GC6719@atrey.karlin.mff.cuni.cz \
    --to=jack@suse.cz \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xhejtman@mail.muni.cz \
    /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®