diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-29 15:15:27 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-29 15:15:27 -0400 |
commit | f254e52c1ce550fdaa0d31f5e068f0d67c2485d4 (patch) | |
tree | 1232b7e16b6f0b1b1b150c5df396452cac5e3853 /fs/btrfs/ctree.c | |
parent | 75dfe3960e602e63ea42ac7a2a0520832b189ffa (diff) |
Btrfs: verify csums on read
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 48c611948d11..1eb333e2e18b 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -109,14 +109,14 @@ static int comp_keys(struct btrfs_disk_key *disk, struct btrfs_key *k2) | |||
109 | return 1; | 109 | return 1; |
110 | if (k1.objectid < k2->objectid) | 110 | if (k1.objectid < k2->objectid) |
111 | return -1; | 111 | return -1; |
112 | if (k1.flags > k2->flags) | ||
113 | return 1; | ||
114 | if (k1.flags < k2->flags) | ||
115 | return -1; | ||
116 | if (k1.offset > k2->offset) | 112 | if (k1.offset > k2->offset) |
117 | return 1; | 113 | return 1; |
118 | if (k1.offset < k2->offset) | 114 | if (k1.offset < k2->offset) |
119 | return -1; | 115 | return -1; |
116 | if (k1.flags > k2->flags) | ||
117 | return 1; | ||
118 | if (k1.flags < k2->flags) | ||
119 | return -1; | ||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
@@ -1165,7 +1165,6 @@ int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, struct btrfs_root | |||
1165 | BUG(); | 1165 | BUG(); |
1166 | ret = btrfs_search_slot(trans, root, cpu_key, path, data_size, 1); | 1166 | ret = btrfs_search_slot(trans, root, cpu_key, path, data_size, 1); |
1167 | if (ret == 0) { | 1167 | if (ret == 0) { |
1168 | btrfs_release_path(root, path); | ||
1169 | return -EEXIST; | 1168 | return -EEXIST; |
1170 | } | 1169 | } |
1171 | if (ret < 0) | 1170 | if (ret < 0) |