From: Tahsin Erdogan <tahsin@google.com>
To: Andreas Dilger <adilger@dilger.ca>,
"Darrick J . Wong" <darrick.wong@oracle.com>,
Jan Kara <jack@suse.cz>, Theodore Ts'o <tytso@mit.edu>,
linux-ext4@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Tahsin Erdogan <tahsin@google.com>
Subject: [PATCH] ext4: fix __ext4_xattr_set_credits()
Date: Wed, 28 Jun 2017 14:47:50 -0700 [thread overview]
Message-ID: <20170628214750.31548-1-tahsin@google.com> (raw)
__ext4_xattr_set_credits() calculates journal credits needed for a
set xattr operation. Currently, credits needed for quota updates are
added only if ea_inode feature is enabled which is wrong. Fix this by
moving quota related additions to above ea_inode feature check.
Fixes: 74c5bfa651af ("ext4: xattr inode deduplication")
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
---
fs/ext4/xattr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index ce12c3fb7e59..062756b4e6d8 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -845,6 +845,9 @@ static int __ext4_xattr_set_credits(struct super_block *sb,
*/
credits = 5;
+ /* Quota updates. */
+ credits += EXT4_MAXQUOTAS_TRANS_BLOCKS(sb);
+
/* We are done if ea_inode feature is not enabled. */
if (!ext4_has_feature_ea_inode(sb))
return credits;
@@ -878,9 +881,6 @@ static int __ext4_xattr_set_credits(struct super_block *sb,
/* Block bitmap and group descriptor updates for each block. */
credits += blocks * 2;
- /* Quota updates. */
- credits += EXT4_MAXQUOTAS_TRANS_BLOCKS(sb);
next reply other threads:[~2017-06-28 21:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 21:47 Tahsin Erdogan [this message]
2017-06-28 22:26 ` [PATCH] ext4: fix __ext4_xattr_set_credits() Andreas Dilger
2017-07-04 4:22 ` Theodore Ts'o
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=20170628214750.31548-1-tahsin@google.com \
--to=tahsin@google.com \
--cc=adilger@dilger.ca \
--cc=darrick.wong@oracle.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@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