Skip to contentSkip to conversation

ext3: fix compilation with quotas enabled

PATCH New Christoph Hellwig 1 participant 1 message Oct 23, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext3: fix compilation with quotas enabled

An error path ext3_quota_on reference the nd variable that is gone now. Instead of fixing this in place change the code slightly so that we use one single callsite for path_put instead of three.

fs/ext3/super.c +6 -6
Index: linux-2.6/fs/ext3/super.c
===================================================================
@@ -2811,9 +2811,10 @@ static int ext3_quota_on(struct super_bl
 
 	/* Quotafile not on the same filesystem? */
 	if (path.mnt->mnt_sb != sb) {
-		path_put(&path);
-		return -EXDEV;
+		err = -EXDEV;
+		goto out_path_put;
 	}
+
 	/* Journaling quota? */
 	if (EXT3_SB(sb)->s_qf_names[type]) {
 		/* Quotafile not of fs root? */
@@ -2835,13 +2836,12 @@ static int ext3_quota_on(struct super_bl
 		journal_lock_updates(EXT3_SB(sb)->s_journal);
 		err = journal_flush(EXT3_SB(sb)->s_journal);
 		journal_unlock_updates(EXT3_SB(sb)->s_journal);
-		if (err) {
-			path_put(&nd.path);
-			return err;
-		}
+		if (err)
+			goto out_path_put;
 	}
 
 	err = vfs_quota_on_path(sb, type, format_id, &path);
+ out_path_put:
 	path_put(&path);
 	return err;
 }