kvm: x86/cpuid: Only provide CPUID leaf 0xA if host has architectural PMU
[linux-2.6-microblaze.git] / drivers / md / dm-integrity.c
index eb4b5e5..ad2d5fa 100644 (file)
@@ -1788,12 +1788,11 @@ again:
                                                checksums_ptr - checksums, dio->op == REQ_OP_READ ? TAG_CMP : TAG_WRITE);
                        if (unlikely(r)) {
                                if (r > 0) {
-                                       char b[BDEVNAME_SIZE];
                                        sector_t s;
 
                                        s = sector - ((r + ic->tag_size - 1) / ic->tag_size);
-                                       DMERR_LIMIT("%s: Checksum failed at sector 0x%llx",
-                                                   bio_devname(bio, b), s);
+                                       DMERR_LIMIT("%pg: Checksum failed at sector 0x%llx",
+                                                   bio->bi_bdev, s);
                                        r = -EILSEQ;
                                        atomic64_inc(&ic->number_of_mismatches);
                                        dm_audit_log_bio(DM_MSG_PREFIX, "integrity-checksum",
@@ -2473,9 +2472,11 @@ static void do_journal_write(struct dm_integrity_c *ic, unsigned write_start,
                                        dm_integrity_io_error(ic, "invalid sector in journal", -EIO);
                                        sec &= ~(sector_t)(ic->sectors_per_block - 1);
                                }
+                               if (unlikely(sec >= ic->provided_data_sectors)) {
+                                       journal_entry_set_unused(je);
+                                       continue;
+                               }
                        }
-                       if (unlikely(sec >= ic->provided_data_sectors))
-                               continue;
                        get_area_and_offset(ic, sec, &area, &offset);
                        restore_last_bytes(ic, access_journal_data(ic, i, j), je);
                        for (k = j + 1; k < ic->journal_section_entries; k++) {