diff options
Diffstat (limited to 'fs/btrfs/check-integrity.c')
-rw-r--r-- | fs/btrfs/check-integrity.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index e0aab4456974..b50764bef141 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c | |||
@@ -77,6 +77,15 @@ | |||
77 | * the integrity of (super)-block write requests, do not | 77 | * the integrity of (super)-block write requests, do not |
78 | * enable the config option BTRFS_FS_CHECK_INTEGRITY to | 78 | * enable the config option BTRFS_FS_CHECK_INTEGRITY to |
79 | * include and compile the integrity check tool. | 79 | * include and compile the integrity check tool. |
80 | * | ||
81 | * Expect millions of lines of information in the kernel log with an | ||
82 | * enabled check_int_print_mask. Therefore set LOG_BUF_SHIFT in the | ||
83 | * kernel config to at least 26 (which is 64MB). Usually the value is | ||
84 | * limited to 21 (which is 2MB) in init/Kconfig. The file needs to be | ||
85 | * changed like this before LOG_BUF_SHIFT can be set to a high value: | ||
86 | * config LOG_BUF_SHIFT | ||
87 | * int "Kernel log buffer size (16 => 64KB, 17 => 128KB)" | ||
88 | * range 12 30 | ||
80 | */ | 89 | */ |
81 | 90 | ||
82 | #include <linux/sched.h> | 91 | #include <linux/sched.h> |
@@ -124,6 +133,7 @@ | |||
124 | #define BTRFSIC_PRINT_MASK_INITIAL_DATABASE 0x00000400 | 133 | #define BTRFSIC_PRINT_MASK_INITIAL_DATABASE 0x00000400 |
125 | #define BTRFSIC_PRINT_MASK_NUM_COPIES 0x00000800 | 134 | #define BTRFSIC_PRINT_MASK_NUM_COPIES 0x00000800 |
126 | #define BTRFSIC_PRINT_MASK_TREE_WITH_ALL_MIRRORS 0x00001000 | 135 | #define BTRFSIC_PRINT_MASK_TREE_WITH_ALL_MIRRORS 0x00001000 |
136 | #define BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH_VERBOSE 0x00002000 | ||
127 | 137 | ||
128 | struct btrfsic_dev_state; | 138 | struct btrfsic_dev_state; |
129 | struct btrfsic_state; | 139 | struct btrfsic_state; |
@@ -3015,6 +3025,7 @@ void btrfsic_submit_bio(int rw, struct bio *bio) | |||
3015 | (rw & WRITE) && NULL != bio->bi_io_vec) { | 3025 | (rw & WRITE) && NULL != bio->bi_io_vec) { |
3016 | unsigned int i; | 3026 | unsigned int i; |
3017 | u64 dev_bytenr; | 3027 | u64 dev_bytenr; |
3028 | u64 cur_bytenr; | ||
3018 | int bio_is_patched; | 3029 | int bio_is_patched; |
3019 | char **mapped_datav; | 3030 | char **mapped_datav; |
3020 | 3031 | ||
@@ -3033,6 +3044,7 @@ void btrfsic_submit_bio(int rw, struct bio *bio) | |||
3033 | GFP_NOFS); | 3044 | GFP_NOFS); |
3034 | if (!mapped_datav) | 3045 | if (!mapped_datav) |
3035 | goto leave; | 3046 | goto leave; |
3047 | cur_bytenr = dev_bytenr; | ||
3036 | for (i = 0; i < bio->bi_vcnt; i++) { | 3048 | for (i = 0; i < bio->bi_vcnt; i++) { |
3037 | BUG_ON(bio->bi_io_vec[i].bv_len != PAGE_CACHE_SIZE); | 3049 | BUG_ON(bio->bi_io_vec[i].bv_len != PAGE_CACHE_SIZE); |
3038 | mapped_datav[i] = kmap(bio->bi_io_vec[i].bv_page); | 3050 | mapped_datav[i] = kmap(bio->bi_io_vec[i].bv_page); |
@@ -3044,16 +3056,13 @@ void btrfsic_submit_bio(int rw, struct bio *bio) | |||
3044 | kfree(mapped_datav); | 3056 | kfree(mapped_datav); |
3045 | goto leave; | 3057 | goto leave; |
3046 | } | 3058 | } |
3047 | if ((BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | | 3059 | if (dev_state->state->print_mask & |
3048 | BTRFSIC_PRINT_MASK_VERBOSE) == | 3060 | BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH_VERBOSE) |
3049 | (dev_state->state->print_mask & | ||
3050 | (BTRFSIC_PRINT_MASK_SUBMIT_BIO_BH | | ||
3051 | BTRFSIC_PRINT_MASK_VERBOSE))) | ||
3052 | printk(KERN_INFO | 3061 | printk(KERN_INFO |
3053 | "#%u: page=%p, len=%u, offset=%u\n", | 3062 | "#%u: bytenr=%llu, len=%u, offset=%u\n", |
3054 | i, bio->bi_io_vec[i].bv_page, | 3063 | i, cur_bytenr, bio->bi_io_vec[i].bv_len, |
3055 | bio->bi_io_vec[i].bv_len, | ||
3056 | bio->bi_io_vec[i].bv_offset); | 3064 | bio->bi_io_vec[i].bv_offset); |
3065 | cur_bytenr += bio->bi_io_vec[i].bv_len; | ||
3057 | } | 3066 | } |
3058 | btrfsic_process_written_block(dev_state, dev_bytenr, | 3067 | btrfsic_process_written_block(dev_state, dev_bytenr, |
3059 | mapped_datav, bio->bi_vcnt, | 3068 | mapped_datav, bio->bi_vcnt, |