#include <linux/xxhash.h>
 #include <linux/key.h>
 #include <linux/random.h>
+#include <linux/ratelimit.h>
 #include <linux/scatterlist.h>
 #include <crypto/algapi.h>
 #include <crypto/chacha.h>
        if (bch2_crc_cmp(merged, crc_old.csum) && !c->opts.no_data_io) {
                struct printbuf buf = PRINTBUF;
                prt_printf(&buf, "checksum error in %s() (memory corruption or bug?)\n"
-                          "expected %0llx:%0llx got %0llx:%0llx (old type ",
+                          "  expected %0llx:%0llx got %0llx:%0llx (old type ",
                           __func__,
                           crc_old.csum.hi,
                           crc_old.csum.lo,
                prt_str(&buf, " new type ");
                bch2_prt_csum_type(&buf, new_csum_type);
                prt_str(&buf, ")");
-               bch_err(c, "%s", buf.buf);
+               WARN_RATELIMIT(1, "%s", buf.buf);
                printbuf_exit(&buf);
                return -EIO;
        }
 
        *_dst = dst;
        return more;
 csum_err:
-       bch_err(c, "%s write error: error verifying existing checksum while rewriting existing data (memory corruption?)",
+       bch_err_inum_offset_ratelimited(c,
+               op->pos.inode,
+               op->pos.offset << 9,
+               "%s write error: error verifying existing checksum while rewriting existing data (memory corruption?)",
                op->flags & BCH_WRITE_MOVE ? "move" : "user");
        ret = -EIO;
 err: