diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-04-26 08:56:42 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-26 08:56:42 -0700 |
| commit | fe6ec59f6229fdd0d1476e05d54f4802cccb669f (patch) | |
| tree | 29160bb4fc9b8528872f3fb39bf6ca453a5f4a5e /fs | |
| parent | 87d218f98b50087dcfb3c895bd2136153ca95ae5 (diff) | |
[PATCH] Minor fixes for ext3 journalled quotas
From: Jan Kara <jack@ucw.cz>
It fixes a memory leak when turning journalled quotas off.
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/ext3/super.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 3ce34d52bdf4..4bbb5a078bbb 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -405,6 +405,12 @@ void ext3_put_super (struct super_block * sb) 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 @@ -897,7 +903,8 @@ clear_qf_name: } } #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; @@ -2249,7 +2256,8 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id, 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) |
