Skip to content

Commit addacc7

Browse files
author
Al Viro
committed
Take dirtying the inode to callers of ext2_free_blocks()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 3889717 commit addacc7

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

fs/ext2/balloc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
572572
brelse(bitmap_bh);
573573
release_blocks(sb, freed);
574574
dquot_free_block_nodirty(inode, freed);
575-
mark_inode_dirty(inode);
576575
}
577576

578577
/**

fs/ext2/inode.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ static int ext2_alloc_blocks(struct inode *inode,
423423
failed_out:
424424
for (i = 0; i <index; i++)
425425
ext2_free_blocks(inode, new_blocks[i], 1);
426+
if (index)
427+
mark_inode_dirty(inode);
426428
return ret;
427429
}
428430

@@ -993,17 +995,17 @@ static inline void ext2_free_data(struct inode *inode, __le32 *p, __le32 *q)
993995
else if (block_to_free == nr - count)
994996
count++;
995997
else {
996-
mark_inode_dirty(inode);
997998
ext2_free_blocks (inode, block_to_free, count);
999+
mark_inode_dirty(inode);
9981000
free_this:
9991001
block_to_free = nr;
10001002
count = 1;
10011003
}
10021004
}
10031005
}
10041006
if (count > 0) {
1005-
mark_inode_dirty(inode);
10061007
ext2_free_blocks (inode, block_to_free, count);
1008+
mark_inode_dirty(inode);
10071009
}
10081010
}
10091011

fs/ext2/xattr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
674674
new_bh = sb_getblk(sb, block);
675675
if (!new_bh) {
676676
ext2_free_blocks(inode, block, 1);
677+
mark_inode_dirty(inode);
677678
error = -EIO;
678679
goto cleanup;
679680
}
@@ -729,6 +730,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
729730
mb_cache_entry_free(ce);
730731
ea_bdebug(old_bh, "freeing");
731732
ext2_free_blocks(inode, old_bh->b_blocknr, 1);
733+
mark_inode_dirty(inode);
732734
/* We let our caller release old_bh, so we
733735
* need to duplicate the buffer before. */
734736
get_bh(old_bh);
@@ -789,6 +791,7 @@ ext2_xattr_delete_inode(struct inode *inode)
789791
if (ce)
790792
mb_cache_entry_free(ce);
791793
ext2_free_blocks(inode, EXT2_I(inode)->i_file_acl, 1);
794+
mark_inode_dirty(inode);
792795
get_bh(bh);
793796
bforget(bh);
794797
unlock_buffer(bh);

0 commit comments

Comments
 (0)