Source
20
20
#include "disk-io.h"
21
21
#include "compression.h"
22
22
#include "volumes.h"
23
23
24
24
/*
25
25
* Error message should follow the following format:
26
26
* corrupt <type>: <identifier>, <reason>[, <bad_value>]
27
27
*
28
28
* @type: leaf or node
29
29
* @identifier: the necessary info to locate the leaf/node.
30
-
* It's recommened to decode key.objecitd/offset if it's
30
+
* It's recommended to decode key.objecitd/offset if it's
31
31
* meaningful.
32
32
* @reason: describe the error
33
-
* @bad_value: optional, it's recommened to output bad value and its
33
+
* @bad_value: optional, it's recommended to output bad value and its
34
34
* expected value (range).
35
35
*
36
36
* Since comma is used to separate the components, only space is allowed
37
37
* inside each component.
38
38
*/
39
39
40
40
/*
41
41
* Append generic "corrupt leaf/node root=%llu block=%llu slot=%d: " to @fmt.
42
42
* Allows callers to customize the output.
43
43
*/
123
123
124
124
if (btrfs_file_extent_type(leaf, fi) > BTRFS_FILE_EXTENT_TYPES) {
125
125
file_extent_err(fs_info, leaf, slot,
126
126
"invalid type for file extent, have %u expect range [0, %u]",
127
127
btrfs_file_extent_type(leaf, fi),
128
128
BTRFS_FILE_EXTENT_TYPES);
129
129
return -EUCLEAN;
130
130
}
131
131
132
132
/*
133
-
* Support for new compression/encrption must introduce incompat flag,
133
+
* Support for new compression/encryption must introduce incompat flag,
134
134
* and must be caught in open_ctree().
135
135
*/
136
136
if (btrfs_file_extent_compression(leaf, fi) > BTRFS_COMPRESS_TYPES) {
137
137
file_extent_err(fs_info, leaf, slot,
138
138
"invalid compression for file extent, have %u expect range [0, %u]",
139
139
btrfs_file_extent_compression(leaf, fi),
140
140
BTRFS_COMPRESS_TYPES);
141
141
return -EUCLEAN;
142
142
}
143
143
if (btrfs_file_extent_encryption(leaf, fi)) {