mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
f2fs: Revert "f2fs: truncate blocks in batch in __complete_revoke_list()"
We should not truncate replaced blocks, and were supposed to truncate the first
part as well.
This reverts commit 78a99fe625
.
Cc: stable@vger.kernel.org
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
a46bebd502
commit
c7dbc06688
1 changed files with 7 additions and 2 deletions
|
@ -265,19 +265,24 @@ static void __complete_revoke_list(struct inode *inode, struct list_head *head,
|
||||||
bool revoke)
|
bool revoke)
|
||||||
{
|
{
|
||||||
struct revoke_entry *cur, *tmp;
|
struct revoke_entry *cur, *tmp;
|
||||||
|
pgoff_t start_index = 0;
|
||||||
bool truncate = is_inode_flag_set(inode, FI_ATOMIC_REPLACE);
|
bool truncate = is_inode_flag_set(inode, FI_ATOMIC_REPLACE);
|
||||||
|
|
||||||
list_for_each_entry_safe(cur, tmp, head, list) {
|
list_for_each_entry_safe(cur, tmp, head, list) {
|
||||||
if (revoke)
|
if (revoke) {
|
||||||
__replace_atomic_write_block(inode, cur->index,
|
__replace_atomic_write_block(inode, cur->index,
|
||||||
cur->old_addr, NULL, true);
|
cur->old_addr, NULL, true);
|
||||||
|
} else if (truncate) {
|
||||||
|
f2fs_truncate_hole(inode, start_index, cur->index);
|
||||||
|
start_index = cur->index + 1;
|
||||||
|
}
|
||||||
|
|
||||||
list_del(&cur->list);
|
list_del(&cur->list);
|
||||||
kmem_cache_free(revoke_entry_slab, cur);
|
kmem_cache_free(revoke_entry_slab, cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!revoke && truncate)
|
if (!revoke && truncate)
|
||||||
f2fs_do_truncate_blocks(inode, 0, false);
|
f2fs_do_truncate_blocks(inode, start_index * PAGE_SIZE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __f2fs_commit_atomic_write(struct inode *inode)
|
static int __f2fs_commit_atomic_write(struct inode *inode)
|
||||||
|
|
Loading…
Reference in a new issue