Jan Kara 941d2380e9 quota: improve inode list scanning in add_dquot_ref()
We restarted scan of sb->s_inodes list whenever we had to drop inode_lock
in add_dquot_ref().  This leads to overall quadratic running time and thus
add_dquot_ref() can take several minutes when called on a life filesystem.
We fix the problem by using the fact that inode cannot be removed from
s_inodes list while we hold a reference to it and thus we can safely
restart the scan if we don't drop the reference.  Here we use the fact that
inodes freshly added to s_inodes list are already guaranteed to have quotas
properly initialized and the ordering of inodes on s_inodes list does not
change so we cannot skip any inode.

Thanks goes to Nick <gentuu@gmail.com> for analyzing the problem and
testing the fix.

[akpm@linux-foundation.org: iput(NULL) is legal]
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Nick <gentuu@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:07 -08:00
..
2007-10-17 08:42:47 -07:00
2008-01-28 23:58:27 -05:00
2007-10-19 11:53:37 -07:00
2008-02-03 17:33:42 +02:00
2007-12-05 09:25:20 -08:00
2007-05-08 11:14:59 -07:00
2007-10-22 08:13:21 -07:00
2008-02-06 10:41:02 -08:00
2008-02-03 17:33:42 +02:00
2008-01-30 13:31:20 +01:00
2008-01-30 13:31:20 +01:00
2008-02-03 15:14:02 +02:00
2008-02-03 15:42:53 +02:00
2007-10-18 14:37:31 -07:00
2008-02-06 10:41:04 -08:00
2007-12-05 09:21:18 -08:00
2008-02-03 18:05:15 +02:00
2007-10-17 08:42:54 -07:00
2008-01-30 13:31:46 +01:00
2008-01-28 23:21:18 +01:00
2008-02-06 10:41:07 -08:00
2007-07-29 17:09:29 -07:00
2008-02-05 09:44:07 -08:00
2007-05-21 09:18:19 -07:00
2007-05-08 11:15:01 -07:00
2008-02-06 10:41:07 -08:00
2007-05-08 11:15:09 -07:00
2007-07-16 09:05:48 -07:00
2008-02-05 14:37:15 -08:00
2008-01-30 13:31:46 +01:00
2008-02-03 17:51:36 -05:00
2008-01-30 13:31:46 +01:00
2007-07-19 10:04:45 -07:00
2007-11-14 18:45:42 -08:00
2007-10-15 17:00:19 +02:00
2008-02-06 10:41:02 -08:00
2007-07-27 15:40:13 -07:00
2007-10-19 11:53:41 -07:00
2008-02-05 09:44:07 -08:00