From d0cc512ac164d546482de2e09cb73d3fa84903ee Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Wed, 19 Sep 2012 14:14:53 -0400 Subject: [PATCH] --- yaml --- r: 331589 b: refs/heads/master c: 18888cf0883c286f238d44ee565530fe82752f06 h: refs/heads/master i: 331587: b570928de425553a71e8977400128a97fb4f5e17 v: v3 --- [refs] | 2 +- trunk/fs/ext4/extents.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 77da7da41ada..15004293fc10 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 59e31c156a24d483bbd2ea07d4dc96043a55b6bc +refs/heads/master: 18888cf0883c286f238d44ee565530fe82752f06 diff --git a/trunk/fs/ext4/extents.c b/trunk/fs/ext4/extents.c index cc6d2b984e8f..a510917c175a 100644 --- a/trunk/fs/ext4/extents.c +++ b/trunk/fs/ext4/extents.c @@ -2318,10 +2318,13 @@ static int ext4_remove_blocks(handle_t *handle, struct inode *inode, struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); unsigned short ee_len = ext4_ext_get_actual_len(ex); ext4_fsblk_t pblk; - int flags = EXT4_FREE_BLOCKS_FORGET; + int flags = 0; if (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) - flags |= EXT4_FREE_BLOCKS_METADATA; + flags |= EXT4_FREE_BLOCKS_METADATA | EXT4_FREE_BLOCKS_FORGET; + else if (ext4_should_journal_data(inode)) + flags |= EXT4_FREE_BLOCKS_FORGET; + /* * For bigalloc file systems, we never free a partial cluster * at the beginning of the extent. Instead, we make a note