diff options
author | Mike Snitzer <snitzer@redhat.com> | 2012-12-21 15:23:34 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-12-21 15:23:34 -0500 |
commit | c397741c7645de7f2ead1f076f1a40e169875fe3 (patch) | |
tree | dba3e0c8ee01a50fa22f2668c34a0d2ab06dc7ba /drivers | |
parent | 89ddeb8cb1383bfdfaaeb458f1c4a91e890cc60b (diff) |
dm thin: use DMERR_LIMIT for errors
Throttle all errors logged from the IO path by dm thin.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-thin.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 6b9322e63651..fba378f234a5 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -567,7 +567,7 @@ static void process_prepared_mapping(struct dm_thin_new_mapping *m) | |||
567 | */ | 567 | */ |
568 | r = dm_thin_insert_block(tc->td, m->virt_block, m->data_block); | 568 | r = dm_thin_insert_block(tc->td, m->virt_block, m->data_block); |
569 | if (r) { | 569 | if (r) { |
570 | DMERR("dm_thin_insert_block() failed"); | 570 | DMERR_LIMIT("dm_thin_insert_block() failed"); |
571 | dm_cell_error(m->cell); | 571 | dm_cell_error(m->cell); |
572 | goto out; | 572 | goto out; |
573 | } | 573 | } |
@@ -622,7 +622,7 @@ static void process_prepared_discard(struct dm_thin_new_mapping *m) | |||
622 | 622 | ||
623 | r = dm_thin_remove_block(tc->td, m->virt_block); | 623 | r = dm_thin_remove_block(tc->td, m->virt_block); |
624 | if (r) | 624 | if (r) |
625 | DMERR("dm_thin_remove_block() failed"); | 625 | DMERR_LIMIT("dm_thin_remove_block() failed"); |
626 | 626 | ||
627 | process_prepared_discard_passdown(m); | 627 | process_prepared_discard_passdown(m); |
628 | } | 628 | } |
@@ -736,7 +736,7 @@ static void schedule_copy(struct thin_c *tc, dm_block_t virt_block, | |||
736 | 0, copy_complete, m); | 736 | 0, copy_complete, m); |
737 | if (r < 0) { | 737 | if (r < 0) { |
738 | mempool_free(m, pool->mapping_pool); | 738 | mempool_free(m, pool->mapping_pool); |
739 | DMERR("dm_kcopyd_copy() failed"); | 739 | DMERR_LIMIT("dm_kcopyd_copy() failed"); |
740 | dm_cell_error(cell); | 740 | dm_cell_error(cell); |
741 | } | 741 | } |
742 | } | 742 | } |
@@ -802,7 +802,7 @@ static void schedule_zero(struct thin_c *tc, dm_block_t virt_block, | |||
802 | r = dm_kcopyd_zero(pool->copier, 1, &to, 0, copy_complete, m); | 802 | r = dm_kcopyd_zero(pool->copier, 1, &to, 0, copy_complete, m); |
803 | if (r < 0) { | 803 | if (r < 0) { |
804 | mempool_free(m, pool->mapping_pool); | 804 | mempool_free(m, pool->mapping_pool); |
805 | DMERR("dm_kcopyd_zero() failed"); | 805 | DMERR_LIMIT("dm_kcopyd_zero() failed"); |
806 | dm_cell_error(cell); | 806 | dm_cell_error(cell); |
807 | } | 807 | } |
808 | } | 808 | } |
@@ -814,7 +814,7 @@ static int commit(struct pool *pool) | |||
814 | 814 | ||
815 | r = dm_pool_commit_metadata(pool->pmd); | 815 | r = dm_pool_commit_metadata(pool->pmd); |
816 | if (r) | 816 | if (r) |
817 | DMERR("commit failed, error = %d", r); | 817 | DMERR_LIMIT("commit failed: error = %d", r); |
818 | 818 | ||
819 | return r; | 819 | return r; |
820 | } | 820 | } |
@@ -997,7 +997,8 @@ static void process_discard(struct thin_c *tc, struct bio *bio) | |||
997 | break; | 997 | break; |
998 | 998 | ||
999 | default: | 999 | default: |
1000 | DMERR("discard: find block unexpectedly returned %d", r); | 1000 | DMERR_LIMIT("%s: dm_thin_find_block() failed: error = %d", |
1001 | __func__, r); | ||
1001 | cell_defer_no_holder(tc, cell); | 1002 | cell_defer_no_holder(tc, cell); |
1002 | bio_io_error(bio); | 1003 | bio_io_error(bio); |
1003 | break; | 1004 | break; |
@@ -1024,7 +1025,8 @@ static void break_sharing(struct thin_c *tc, struct bio *bio, dm_block_t block, | |||
1024 | break; | 1025 | break; |
1025 | 1026 | ||
1026 | default: | 1027 | default: |
1027 | DMERR("%s: alloc_data_block() failed, error = %d", __func__, r); | 1028 | DMERR_LIMIT("%s: alloc_data_block() failed: error = %d", |
1029 | __func__, r); | ||
1028 | dm_cell_error(cell); | 1030 | dm_cell_error(cell); |
1029 | break; | 1031 | break; |
1030 | } | 1032 | } |
@@ -1100,7 +1102,8 @@ static void provision_block(struct thin_c *tc, struct bio *bio, dm_block_t block | |||
1100 | break; | 1102 | break; |
1101 | 1103 | ||
1102 | default: | 1104 | default: |
1103 | DMERR("%s: alloc_data_block() failed, error = %d", __func__, r); | 1105 | DMERR_LIMIT("%s: alloc_data_block() failed: error = %d", |
1106 | __func__, r); | ||
1104 | set_pool_mode(tc->pool, PM_READ_ONLY); | 1107 | set_pool_mode(tc->pool, PM_READ_ONLY); |
1105 | dm_cell_error(cell); | 1108 | dm_cell_error(cell); |
1106 | break; | 1109 | break; |
@@ -1148,7 +1151,8 @@ static void process_bio(struct thin_c *tc, struct bio *bio) | |||
1148 | break; | 1151 | break; |
1149 | 1152 | ||
1150 | default: | 1153 | default: |
1151 | DMERR("dm_thin_find_block() failed, error = %d", r); | 1154 | DMERR_LIMIT("%s: dm_thin_find_block() failed: error = %d", |
1155 | __func__, r); | ||
1152 | cell_defer_no_holder(tc, cell); | 1156 | cell_defer_no_holder(tc, cell); |
1153 | bio_io_error(bio); | 1157 | bio_io_error(bio); |
1154 | break; | 1158 | break; |
@@ -1190,7 +1194,8 @@ static void process_bio_read_only(struct thin_c *tc, struct bio *bio) | |||
1190 | break; | 1194 | break; |
1191 | 1195 | ||
1192 | default: | 1196 | default: |
1193 | DMERR("dm_thin_find_block() failed, error = %d", r); | 1197 | DMERR_LIMIT("%s: dm_thin_find_block() failed: error = %d", |
1198 | __func__, r); | ||
1194 | bio_io_error(bio); | 1199 | bio_io_error(bio); |
1195 | break; | 1200 | break; |
1196 | } | 1201 | } |