From: Christoph Hellwig <hch@lst.de>
To: torvalds@osdl.org
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH] ext3: fix compilation with quotas enabled
Date: Thu, 23 Oct 2008 20:28:39 +0200 [thread overview]
Message-ID: <20081023182839.GA25764@lst.de> (raw)
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.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/ext3/super.c
===================================================================
--- linux-2.6.orig/fs/ext3/super.c 2008-10-23 20:23:04.000000000 +0200
+++ linux-2.6/fs/ext3/super.c 2008-10-23 20:28:20.000000000 +0200
@@ -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;
}
reply other threads:[~2008-10-23 18:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081023182839.GA25764@lst.de \
--to=hch@lst.de \
--cc=linux-ext4@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).