Merge tag 'csky-for-linus-4.20-fixup-dtb' of https://github.com/c-sky/csky-linux
[linux-block.git] / fs / btrfs / tree-log.c
index 0dba09334a163ab9222c22335fc22f46cfbcd5da..e07f3376b7dfc0c9350117bf3db956781e57d45e 100644 (file)
@@ -4390,7 +4390,6 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
 
        INIT_LIST_HEAD(&extents);
 
-       down_write(&inode->dio_sem);
        write_lock(&tree->lock);
        test_gen = root->fs_info->last_trans_committed;
        logged_start = start;
@@ -4456,7 +4455,6 @@ process:
        }
        WARN_ON(!list_empty(&extents));
        write_unlock(&tree->lock);
-       up_write(&inode->dio_sem);
 
        btrfs_release_path(path);
        if (!ret)
@@ -4652,7 +4650,8 @@ static int btrfs_log_trailing_hole(struct btrfs_trans_handle *trans,
                        ASSERT(len == i_size ||
                               (len == fs_info->sectorsize &&
                                btrfs_file_extent_compression(leaf, extent) !=
-                               BTRFS_COMPRESS_NONE));
+                               BTRFS_COMPRESS_NONE) ||
+                              (len < i_size && i_size < fs_info->sectorsize));
                        return 0;
                }