linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Priebe <s.priebe@profihost.ag>
To: "Георгий Стариков" <gstarikov@gmail.com>
Cc: "linux-bcache@vger.kernel.org" <linux-bcache@vger.kernel.org>
Subject: Re: bcache cant register cache device "bad csum" & "bad magic"
Date: Sat, 15 Aug 2015 20:25:56 +0200	[thread overview]
Message-ID: <55CF8434.20602@profihost.ag> (raw)
In-Reply-To: <CAOOKTyA_3agb0jNpB8RumB+8iRX=BnmmhCj6tKM6kzYWAU0AVw@mail.gmail.com>


Am 15.08.2015 um 20:24 schrieb Георгий Стариков:
> how?
> as i see, discard is disabled...
>
> # cat /sys/block/sdc/bcache/discard
> 0
>
> # ./bcache-status -s | grep Discard
>    Discard?                  False

OK sorry. I've only seen exactly this issue after reboot with discard 
enabled.

Sorry.

Stefan

>
>
> 2015-08-15 21:12 GMT+03:00 Stefan Priebe - Profihost AG <s.priebe@profihost.ag>:
>> Disable discard ;-) no fix available.
>>
>> Stefan
>>
>> Excuse my typo sent from my mobile phone.
>>
>> Am 15.08.2015 um 19:54 schrieb Георгий Стариков <gstarikov@gmail.com>:
>>
>> Hi!
>> I lost bcache device after a reboot and dmesg contains the following:
>> [   26.991085] bcache: prio_read() bad csum reading priorities
>> [   26.991088] bcache: prio_read() bad magic reading priorities
>> [   26.991425] attempt to access beyond end of device
>> [   26.991428] sdc: rw=48, want=3405010361836132352, limit=468862128
>> [   26.991430] bcache: error on 4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27:
>> accessing                                            priorities,
>> disabling caching
>>
>> how to fix it?
>>
>> i am using the following fix (recreate cache device with the old cuid)
>> and it works till next reboot.
>>
>> # bcache-super-show /dev/sdc
>> sb.magic                ok
>> sb.first_sector         8 [match]
>> sb.csum                 F19B35ED4C357841 [match]
>> sb.version              3 [cache device]
>>
>> dev.label               (empty)
>> dev.uuid                7dddbf16-ca58-48e3-82d8-da47ae7726dc
>> dev.sectors_per_block   1
>> dev.sectors_per_bucket  1024
>> dev.cache.first_sector  1024
>> dev.cache.cache_sectors 468860928
>> dev.cache.total_sectors 468861952
>> dev.cache.ordered       yes
>> dev.cache.discard       no
>> dev.cache.pos           0
>> dev.cache.replacement   0 [lru]
>>
>> cset.uuid               4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27
>>
>> # make-bcache -C --cset-uuid 4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27 /dev/sdc
>> Already a bcache device on /dev/sdc, overwrite with --wipe-bcache
>>
>> make-bcache -C --wipe-bcache --cset-uuid
>> 4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27 /dev/sdc
>> Device /dev/sdc already has a non-bcache superblock, remove it using
>> wipefs and wipefs -a
>>
>> # wipefs -a /dev/sdc
>>
>> # make-bcache -C --wipe-bcache --cset-uuid
>> 4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27 /dev/sdc
>> UUID:                   f7d97543-69ea-4636-a4ff-ab925ab5abdd
>> Set UUID:               4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27
>> version:                0
>> nbuckets:               457873
>> block_size:             1
>> bucket_size:            1024
>> nr_in_set:              1
>> nr_this_dev:            0
>> first_bucket:           1
>>
>> # echo /dev/sdc > /sys/fs/bcache/register
>>
>> dmesg:
>> [42999.742342] bcache: run_cache_set() invalidating existing data
>> [42999.900046] bcache: bch_cached_dev_attach() Caching md0 as bcache0
>> on set 4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27
>> [42999.900067] bcache: register_cache() registered cache device sdc
>> [43002.019693] EXT4-fs (bcache0): recovery complete
>> [43002.043362] EXT4-fs (bcache0): mounted filesystem with ordered data
>> mode. Opts: discard,errors=remount-ro
>>
>> and final steps:
>> # echo writethrough > /sys/block/bcache0/bcache/cache_mode
>> # echo 128k > /sys/block/bcache0/bcache/sequential_cutoff
>>
>> # ./bcache-status -s
>> --- bcache ---
>> Device                      /dev/bcache0 (251:0)
>> UUID                        4ca0fbc9-d20b-4a3d-bbd1-38d9a5810c27
>> Block Size                  0.50KiB
>> Bucket Size                 512.00KiB
>> Congested?                  False
>> Read Congestion             2.0ms
>> Write Congestion            20.0ms
>> Total Cache Size            223.57GiB
>> Total Cache Used            2.24GiB     (0%)
>> Total Cache Unused          221.34GiB   (99%)
>> Dirty Data                  0B  (0%)
>> Evictable Cache             223.57GiB   (100%)
>> Replacement Policy          [lru] fifo random
>> Cache Mode                  [writethrough] writeback writearound none
>> Total Hits                  139 (3%)
>> Total Misses                3816
>> Total Bypass Hits           0
>> Total Bypass Misses         0
>> Total Bypassed              0B
>> --- Backing Device ---
>>   Device                    /dev/md0 (9:0)
>>   Size                      5.46TiB
>>   Cache Mode                [writethrough] writeback writearound none
>>   Readahead                 0
>>   Sequential Cutoff         128.00KiB
>>   Merge sequential?         False
>>   State                     clean
>>   Writeback?                True
>>   Dirty Data                0B
>>   Total Hits                139 (3%)
>>   Total Misses              3816
>>   Total Bypass Hits         0
>>   Total Bypass Misses       0
>>   Total Bypassed            0B
>> --- Cache Device ---
>>   Device                    /dev/sdc (8:32)
>>   Size                      223.57GiB
>>   Block Size                0.50KiB
>>   Bucket Size               512.00KiB
>>   Replacement Policy        [lru] fifo random
>>   Discard?                  False
>>   I/O Errors                0
>>   Metadata Written          1.60MiB
>>   Data Written              19.20MiB
>>   Buckets                   457873
>>   Cache Used                2.24GiB     (0%)
>>   Cache Unused              221.34GiB   (99%)
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

      reply	other threads:[~2015-08-15 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15 17:54 bcache cant register cache device "bad csum" & "bad magic" Георгий Стариков
     [not found] ` <77CE39AF-AD1A-4F4D-94EB-7D199EC60C74@profihost.ag>
2015-08-15 18:24   ` Георгий Стариков
2015-08-15 18:25     ` Stefan Priebe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CF8434.20602@profihost.ag \
    --to=s.priebe@profihost.ag \
    --cc=gstarikov@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).