aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6af08bcc6f40..33fd37c4b0e0 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5377,6 +5377,11 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
5377 struct inode *inode = d_inode(path->dentry); 5377 struct inode *inode = d_inode(path->dentry);
5378 handle_t *handle; 5378 handle_t *handle;
5379 5379
5380 /*
5381 * Set inode flags to prevent userspace from messing with quota
5382 * files. If this fails, we return success anyway since quotas
5383 * are already enabled and this is not a hard failure.
5384 */
5380 inode_lock(inode); 5385 inode_lock(inode);
5381 handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1); 5386 handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1);
5382 if (IS_ERR(handle)) 5387 if (IS_ERR(handle))
@@ -5477,8 +5482,11 @@ static int ext4_quota_off(struct super_block *sb, int type)
5477 goto out_put; 5482 goto out_put;
5478 5483
5479 inode_lock(inode); 5484 inode_lock(inode);
5480 /* Update modification times of quota files when userspace can 5485 /*
5481 * start looking at them */ 5486 * Update modification times of quota files when userspace can
5487 * start looking at them. If we fail, we return success anyway since
5488 * this is not a hard failure and quotas are already disabled.
5489 */
5482 handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1); 5490 handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1);
5483 if (IS_ERR(handle)) 5491 if (IS_ERR(handle))
5484 goto out_unlock; 5492 goto out_unlock;