Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112940
b: refs/heads/master
c: 166348d
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Theodore Ts'o committed Sep 9, 2008
1 parent 6a399e1 commit 5b33e29
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 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: 68629f29c6764c37ebdceec2f6bbef6637eaf420
refs/heads/master: 166348dd37a4baacfb6fe495954b56f56b116f0c
2 changes: 1 addition & 1 deletion trunk/fs/ext4/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,7 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
/*
* Account for the allocated meta blocks
*/
if (!(*errp)) {
if (!(*errp) && EXT4_I(inode)->i_delalloc_reserved_flag) {
spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
EXT4_I(inode)->i_allocated_meta_blocks += *count;
spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
Expand Down
36 changes: 15 additions & 21 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2170,18 +2170,24 @@ static int ext4_da_get_block_write(struct inode *inode, sector_t iblock,
handle_t *handle = NULL;

handle = ext4_journal_current_handle();
if (!handle) {
ret = ext4_get_blocks_wrap(handle, inode, iblock, max_blocks,
bh_result, 0, 0, 0);
BUG_ON(!ret);
} else {
ret = ext4_get_blocks_wrap(handle, inode, iblock, max_blocks,
bh_result, create, 0, EXT4_DELALLOC_RSVED);
}

BUG_ON(!handle);
ret = ext4_get_blocks_wrap(handle, inode, iblock, max_blocks,
bh_result, create, 0, EXT4_DELALLOC_RSVED);
if (ret > 0) {

bh_result->b_size = (ret << inode->i_blkbits);

if (ext4_should_order_data(inode)) {
int retval;
retval = ext4_jbd2_file_inode(handle, inode);
if (retval)
/*
* Failed to add inode for ordered
* mode. Don't update file size
*/
return retval;
}

/*
* Update on-disk size along with block allocation
* we don't use 'extend_disksize' as size may change
Expand Down Expand Up @@ -2407,18 +2413,6 @@ static int ext4_da_writepages(struct address_space *mapping,
dump_stack();
goto out_writepages;
}
if (ext4_should_order_data(inode)) {
/*
* With ordered mode we need to add
* the inode to the journal handl
* when we do block allocation.
*/
ret = ext4_jbd2_file_inode(handle, inode);
if (ret) {
ext4_journal_stop(handle);
goto out_writepages;
}
}

to_write -= wbc->nr_to_write;
ret = mpage_da_writepages(mapping, wbc,
Expand Down

0 comments on commit 5b33e29

Please sign in to comment.