diff options
Diffstat (limited to 'fs/ext4/super.c')
| -rw-r--r-- | fs/ext4/super.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 4550b83ab1c9..3c1397fa83df 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -2698,8 +2698,11 @@ static int ext4_release_dquot(struct dquot *dquot) | |||
| 2698 | 2698 | ||
| 2699 | handle = ext4_journal_start(dquot_to_inode(dquot), | 2699 | handle = ext4_journal_start(dquot_to_inode(dquot), |
| 2700 | EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb)); | 2700 | EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb)); |
| 2701 | if (IS_ERR(handle)) | 2701 | if (IS_ERR(handle)) { |
| 2702 | /* Release dquot anyway to avoid endless cycle in dqput() */ | ||
| 2703 | dquot_release(dquot); | ||
| 2702 | return PTR_ERR(handle); | 2704 | return PTR_ERR(handle); |
| 2705 | } | ||
| 2703 | ret = dquot_release(dquot); | 2706 | ret = dquot_release(dquot); |
| 2704 | err = ext4_journal_stop(handle); | 2707 | err = ext4_journal_stop(handle); |
| 2705 | if (!ret) | 2708 | if (!ret) |
| @@ -2832,6 +2835,12 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, | |||
| 2832 | struct buffer_head *bh; | 2835 | struct buffer_head *bh; |
| 2833 | handle_t *handle = journal_current_handle(); | 2836 | handle_t *handle = journal_current_handle(); |
| 2834 | 2837 | ||
| 2838 | if (!handle) { | ||
| 2839 | printk(KERN_WARNING "EXT4-fs: Quota write (off=%Lu, len=%Lu)" | ||
| 2840 | " cancelled because transaction is not started.\n", | ||
| 2841 | (unsigned long long)off, (unsigned long long)len); | ||
| 2842 | return -EIO; | ||
| 2843 | } | ||
| 2835 | mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); | 2844 | mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA); |
| 2836 | while (towrite > 0) { | 2845 | while (towrite > 0) { |
| 2837 | tocopy = sb->s_blocksize - offset < towrite ? | 2846 | tocopy = sb->s_blocksize - offset < towrite ? |
