Skip to content

Commit

Permalink
Take dirtying the inode to callers of ext2_free_blocks()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Aug 9, 2010
1 parent 3889717 commit addacc7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion fs/ext2/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
brelse(bitmap_bh);
release_blocks(sb, freed);
dquot_free_block_nodirty(inode, freed);
mark_inode_dirty(inode);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions fs/ext2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ static int ext2_alloc_blocks(struct inode *inode,
failed_out:
for (i = 0; i <index; i++)
ext2_free_blocks(inode, new_blocks[i], 1);
if (index)
mark_inode_dirty(inode);
return ret;
}

Expand Down Expand Up @@ -993,17 +995,17 @@ static inline void ext2_free_data(struct inode *inode, __le32 *p, __le32 *q)
else if (block_to_free == nr - count)
count++;
else {
mark_inode_dirty(inode);
ext2_free_blocks (inode, block_to_free, count);
mark_inode_dirty(inode);
free_this:
block_to_free = nr;
count = 1;
}
}
}
if (count > 0) {
mark_inode_dirty(inode);
ext2_free_blocks (inode, block_to_free, count);
mark_inode_dirty(inode);
}
}

Expand Down
3 changes: 3 additions & 0 deletions fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
new_bh = sb_getblk(sb, block);
if (!new_bh) {
ext2_free_blocks(inode, block, 1);
mark_inode_dirty(inode);
error = -EIO;
goto cleanup;
}
Expand Down Expand Up @@ -729,6 +730,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
mb_cache_entry_free(ce);
ea_bdebug(old_bh, "freeing");
ext2_free_blocks(inode, old_bh->b_blocknr, 1);
mark_inode_dirty(inode);
/* We let our caller release old_bh, so we
* need to duplicate the buffer before. */
get_bh(old_bh);
Expand Down Expand Up @@ -789,6 +791,7 @@ ext2_xattr_delete_inode(struct inode *inode)
if (ce)
mb_cache_entry_free(ce);
ext2_free_blocks(inode, EXT2_I(inode)->i_file_acl, 1);
mark_inode_dirty(inode);
get_bh(bh);
bforget(bh);
unlock_buffer(bh);
Expand Down

0 comments on commit addacc7

Please sign in to comment.