diff options
author | Jan Kara <jack@suse.cz> | 2017-04-24 16:49:16 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2017-04-24 16:49:16 +0200 |
commit | 61a929870d1ce9c7ac34644bfd5aa9a8bf67818c (patch) | |
tree | b75bd4b83d35029cfd904c09e43250e67ff16a02 /fs/ext4/super.c | |
parent | 5c26eac43a0b708083ebd99e0ba57c9b268cef84 (diff) | |
download | linux-61a929870d1ce9c7ac34644bfd5aa9a8bf67818c.tar.bz2 |
ext4: Improve comments in ext4_quota_{on|off}()
Improve comments in ext4_quota_{on|off}() to explain that returning
success despite ext4_journal_start() failing is deliberate.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 12 |
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, struct inode *inode = d_inode(path->dentry); handle_t *handle; + /* + * Set inode flags to prevent userspace from messing with quota + * files. If this fails, we return success anyway since quotas + * are already enabled and this is not a hard failure. + */ inode_lock(inode); handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1); if (IS_ERR(handle)) @@ -5477,8 +5482,11 @@ static int ext4_quota_off(struct super_block *sb, int type) goto out_put; inode_lock(inode); - /* Update modification times of quota files when userspace can - * start looking at them */ + /* + * Update modification times of quota files when userspace can + * start looking at them. If we fail, we return success anyway since + * this is not a hard failure and quotas are already disabled. + */ handle = ext4_journal_start(inode, EXT4_HT_QUOTA, 1); if (IS_ERR(handle)) goto out_unlock; |