vfs: fix bad hashing of dentries
[firefly-linux-kernel-4.4.55.git] / fs / btrfs / tree-log.c
index c276ac9a0ec338c86973a752d74b9e93d22cc9a8..bca436330681a7825fae10c826a20baa17e51c7c 100644 (file)
@@ -3314,7 +3314,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
                btrfs_set_token_file_extent_type(leaf, fi,
                                                 BTRFS_FILE_EXTENT_REG,
                                                 &token);
-               if (em->block_start == 0)
+               if (em->block_start == EXTENT_MAP_HOLE)
                        skip_csum = true;
        }
 
@@ -3728,8 +3728,9 @@ next_slot:
        }
 
 log_extents:
+       btrfs_release_path(path);
+       btrfs_release_path(dst_path);
        if (fast_search) {
-               btrfs_release_path(dst_path);
                ret = btrfs_log_changed_extents(trans, root, inode, dst_path);
                if (ret) {
                        err = ret;
@@ -3746,8 +3747,6 @@ log_extents:
        }
 
        if (inode_only == LOG_INODE_ALL && S_ISDIR(inode->i_mode)) {
-               btrfs_release_path(path);
-               btrfs_release_path(dst_path);
                ret = log_directory_changes(trans, root, inode, path, dst_path);
                if (ret) {
                        err = ret;