Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64857
b: refs/heads/master
c: 9c3013e
h: refs/heads/master
i:
  64855: cd0c61f
v: v3
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Sep 12, 2007
1 parent d575145 commit 23bbe4d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af7b83f9324a77ef9a9080044bf0461f444ca651
refs/heads/master: 9c3013e9b91ad23ecae88e45405e98208cce455d
11 changes: 10 additions & 1 deletion trunk/fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2578,8 +2578,11 @@ static int ext3_release_dquot(struct dquot *dquot)

handle = ext3_journal_start(dquot_to_inode(dquot),
EXT3_QUOTA_DEL_BLOCKS(dquot->dq_sb));
if (IS_ERR(handle))
if (IS_ERR(handle)) {
/* Release dquot anyway to avoid endless cycle in dqput() */
dquot_release(dquot);
return PTR_ERR(handle);
}
ret = dquot_release(dquot);
err = ext3_journal_stop(handle);
if (!ret)
Expand Down Expand Up @@ -2712,6 +2715,12 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type,
struct buffer_head *bh;
handle_t *handle = journal_current_handle();

if (!handle) {
printk(KERN_WARNING "EXT3-fs: Quota write (off=%Lu, len=%Lu)"
" cancelled because transaction is not started.\n",
(unsigned long long)off, (unsigned long long)len);
return -EIO;
}
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
while (towrite > 0) {
tocopy = sb->s_blocksize - offset < towrite ?
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2698,8 +2698,11 @@ static int ext4_release_dquot(struct dquot *dquot)

handle = ext4_journal_start(dquot_to_inode(dquot),
EXT4_QUOTA_DEL_BLOCKS(dquot->dq_sb));
if (IS_ERR(handle))
if (IS_ERR(handle)) {
/* Release dquot anyway to avoid endless cycle in dqput() */
dquot_release(dquot);
return PTR_ERR(handle);
}
ret = dquot_release(dquot);
err = ext4_journal_stop(handle);
if (!ret)
Expand Down Expand Up @@ -2832,6 +2835,12 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
struct buffer_head *bh;
handle_t *handle = journal_current_handle();

if (!handle) {
printk(KERN_WARNING "EXT4-fs: Quota write (off=%Lu, len=%Lu)"
" cancelled because transaction is not started.\n",
(unsigned long long)off, (unsigned long long)len);
return -EIO;
}
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
while (towrite > 0) {
tocopy = sb->s_blocksize - offset < towrite ?
Expand Down
13 changes: 11 additions & 2 deletions trunk/fs/reiserfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1915,8 +1915,11 @@ static int reiserfs_release_dquot(struct dquot *dquot)
ret =
journal_begin(&th, dquot->dq_sb,
REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb));
if (ret)
if (ret) {
/* Release dquot anyway to avoid endless cycle in dqput() */
dquot_release(dquot);
goto out;
}
ret = dquot_release(dquot);
err =
journal_end(&th, dquot->dq_sb,
Expand Down Expand Up @@ -2067,6 +2070,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
size_t towrite = len;
struct buffer_head tmp_bh, *bh;

if (!current->journal_info) {
printk(KERN_WARNING "reiserfs: Quota write (off=%Lu, len=%Lu)"
" cancelled because transaction is not started.\n",
(unsigned long long)off, (unsigned long long)len);
return -EIO;
}
mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
while (towrite > 0) {
tocopy = sb->s_blocksize - offset < towrite ?
Expand Down Expand Up @@ -2098,7 +2107,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
data += tocopy;
blk++;
}
out:
out:
if (len == towrite)
return err;
if (inode->i_size < off + len - towrite)
Expand Down

0 comments on commit 23bbe4d

Please sign in to comment.