Btrfs: remove ASSERT in btrfs_truncate_inode_items
authorLiu Bo <bo.li.liu@oracle.com>
Fri, 3 Mar 2017 02:41:19 +0000 (18:41 -0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Apr 2017 12:07:23 +0000 (14:07 +0200)
After 76b42abbf748 ("Btrfs: fix data loss after truncate when using the
no-holes feature"),

For either NO_HOLES or inline extents, we've set last_size to newsize to
avoid data loss after remount or inode got evicted and read again, thus,
we don't need this check anymore.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 5e71f1ea3391b034dc8e6f55f62d82dbe76e9811..568b28114f0982eff2d95a0db14dc266384109b4 100644 (file)
@@ -4603,13 +4603,6 @@ error:
 
        btrfs_free_path(path);
 
-       if (err == 0) {
-               /* only inline file may have last_size != new_size */
-               if (new_size >= fs_info->sectorsize ||
-                   new_size > fs_info->max_inline)
-                       ASSERT(last_size == new_size);
-       }
-
        if (be_nice && bytes_deleted > SZ_32M) {
                unsigned long updates = trans->delayed_ref_updates;
                if (updates) {