mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Minor fixes in journalled quota
@ 2004-04-23 19:37 Jan Kara
  2004-04-23 20:46 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2004-04-23 19:37 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel

  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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Minor fixes in journalled quota
  2004-04-23 19:37 [PATCH] Minor fixes in journalled quota Jan Kara
@ 2004-04-23 20:46 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2004-04-23 20:46 UTC (permalink / raw)
  To: Jan Kara; +Cc: torvalds, linux-kernel

Jan Kara <jack@ucw.cz> wrote:
>
> 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?

Is OK - I silently corrected it ;)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-23 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-23 19:37 [PATCH] Minor fixes in journalled quota Jan Kara
2004-04-23 20:46 ` Andrew Morton

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®