From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Theodore Ts'o" <tytso@mit.edu>, Jan Kara <jack@suse.cz>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] ext4: set an error code in ext4_quota_off()
Date: Fri, 21 Apr 2017 13:53:45 +0300 [thread overview]
Message-ID: <20170421105345.slxfkl3jf2ucq6h7@mwanda> (raw)
We accidentally return success instead of a negative error code on these
paths.
Fixes: 957153fce8d2 ("ext4: Set flags on quota files directly")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 4a32c9279f35..735adca37fdf 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5377,8 +5377,10 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
inode_lock(inode);
handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1);
- if (IS_ERR(handle))
+ if (IS_ERR(handle)) {
+ err = PTR_ERR(handle);
goto unlock_inode;
+ }
EXT4_I(inode)->i_flags |= EXT4_NOATIME_FL | EXT4_IMMUTABLE_FL;
inode_set_flags(inode, S_NOATIME | S_IMMUTABLE,
S_NOATIME | S_IMMUTABLE);
@@ -5478,8 +5480,10 @@ static int ext4_quota_off(struct super_block *sb, int type)
/* Update modification times of quota files when userspace can
* start looking at them */
handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1);
- if (IS_ERR(handle))
+ if (IS_ERR(handle)) {
+ err = PTR_ERR(handle);
goto out_unlock;
+ }
EXT4_I(inode)->i_flags &= ~(EXT4_NOATIME_FL | EXT4_IMMUTABLE_FL);
inode_set_flags(inode, 0, S_NOATIME | S_IMMUTABLE);
inode->i_mtime = inode->i_ctime = current_time(inode);
next reply other threads:[~2017-04-21 10:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-21 10:53 Dan Carpenter [this message]
2017-04-24 14:46 ` [PATCH] ext4: set an error code in ext4_quota_off() Jan Kara
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=20170421105345.slxfkl3jf2ucq6h7@mwanda \
--to=dan.carpenter@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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