Thread (11 messages) 11 messages, 4 authors, 2017-02-17

Re: size limit for backing store? block sizes? ("[sdx] Bad block number requested")

From: Kai Krakow <hidden>
Date: 2017-02-17 08:05:36

Am Tue, 14 Feb 2017 12:05:48 +0100
schrieb "Jens-U. Mozdzen" [off-list ref]:
quoted hunk ↗ jump to hunk
Hi *,

Zitat von Eric Wheeler [off-list ref]:
quoted
On Wed, 8 Feb 2017, Kai Krakow wrote:
[...]  
quoted
What I meant is "make-bcacke --block X". It defaults to X=512b. I
think you may want to force it to 4k and see if your problem
persists.  
Maybe --block 4096 should be default in make-bcache?

Kent, is there any reason this wouldn't be a good idea?  
actually, make-bcache seems not to default to 512 octets. If no  
specific block size is specified on the command line, it determines  
the maximum sector size of the devices involved:
--- cut here ---
if (!block_size) {
		for (i = 0; i < ncache_devices; i++)
			block_size = max(block_size,
					 get_blocksize(cache_devices[i]));

		for (i = 0; i < nbacking_devices; i++)
			block_size = max(block_size,
					 get_blocksize(backing_devices[i]));
}
--- cut here ---
get_blocksize() queries the logical block size as reported by the  
device ( ioctl(fd, BLKSSZGET, &logical_block_size) ).

At least that's what I see at  
https://github.com/g2p/bcache-tools/blob/master/make-bcache.c, said
to be from Apr 16, 2014. And it seems to be the reason why invoking  
"make-bcache -B ... -C ..." did create a proper setup for me, while  
separating that to "make-bcache -B ..." and "make-bcache -C ..."  
created a wrongly set up caching device for me (backing device has
4k sector size, caching device 512b).
The call to max() in this function clearly tells that both devices
(backing and cache) should use the same block size.

I still wonder why attaching different block-sized devices wasn't
denied for you. When I tried it once, it didn't work.

-- 
Regards,
Kai

Replies to list-only preferred.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help