lkml.org 
[lkml]   [2004]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Minor fixes in journalled quota
  Hello Linus!

I'm sending you a few minor fixes to the quota code - it fixes one
memory leak when turning journalled quotas off and does a trivial code
cleanup. Please apply.

Honza

PS: Andrew, this patch is needed for the dirty-list patch I sent
yesterday to apply cleanly. Somehow I forgot to send you it :(. Should
I resend you it?

diff -ruX /home/jack/.kerndiffexclude linux-2.6.5-2-jquota/fs/ext3/super.c linux-2.6.5-3-jquota2/fs/ext3/super.c
--- linux-2.6.5-2-jquota/fs/ext3/super.c 2004-03-22 21:29:49.000000000 +0100
+++ linux-2.6.5-3-jquota2/fs/ext3/super.c 2004-03-30 16:06:18.000000000 +0200
@@ -405,6 +405,12 @@
kfree(sbi->s_group_desc);
kfree(sbi->s_debts);
brelse(sbi->s_sbh);
+#ifdef CONFIG_QUOTA
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if (sbi->s_qf_names[i])
+ kfree(sbi->s_qf_names[i]);
+ }
+#endif

/* Debugging code just in case the in-memory inode orphan list
* isn't empty. The on-disk one can be non-empty if we've
@@ -893,7 +899,8 @@
}
}
#ifdef CONFIG_QUOTA
- if (!sbi->s_jquota_fmt && (sbi->s_qf_names[0] || sbi->s_qf_names[1])) {
+ if (!sbi->s_jquota_fmt && (sbi->s_qf_names[USRQUOTA] ||
+ sbi->s_qf_names[GRPQUOTA])) {
printk(KERN_ERR
"EXT3-fs: journalled quota format not specified.\n");
return 0;
@@ -2170,8 +2177,8 @@
static int ext3_mark_dquot_dirty(struct dquot * dquot)
{
/* Are we journalling quotas? */
- if (EXT3_SB(dquot->dq_sb)->s_qf_names[0] ||
- EXT3_SB(dquot->dq_sb)->s_qf_names[1])
+ if (EXT3_SB(dquot->dq_sb)->s_qf_names[USRQUOTA] ||
+ EXT3_SB(dquot->dq_sb)->s_qf_names[GRPQUOTA])
return ext3_write_dquot(dquot);
else
return dquot_mark_dquot_dirty(dquot);
@@ -2240,7 +2247,8 @@
struct nameidata nd;

/* Not journalling quota? */
- if (!EXT3_SB(sb)->s_qf_names[0] && !EXT3_SB(sb)->s_qf_names[1])
+ if (!EXT3_SB(sb)->s_qf_names[USRQUOTA] &&
+ !EXT3_SB(sb)->s_qf_names[GRPQUOTA])
return vfs_quota_on(sb, type, format_id, path);
err = path_lookup(path, LOOKUP_FOLLOW, &nd);
if (err)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.030 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site