Increasing hard sector size

Submitted by mcatos
on February 16, 2007 - 8:10am

I'm writing a stacking block driver and I want to use a hard sector size larger than PAGE_SIZE (4096). It works fine with a sector size of 4K but when I try to use an 8K sector size, I get a BUG in add_disk. Is it possible to use such a big sector size? If yes, what am I doing wrong?

Error message I get:

BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004
printing eip:
c016cb57
*pde = 00000000
Oops: 0000 [#1]
SMP
CPU: 0
EIP: 0060:[] Not tainted VLI
EFLAGS: 00010246 (2.6.17.13-ubuntu1-mcatos1 #1)
EIP is at create_empty_buffers+0x17/0x90
eax: 00000000 ebx: c13e1c40 ecx: 00000001 edx: 00002000
esi: 00000000 edi: 00000000 ebp: c14776ac esp: c1f3bbec
ds: 007b es: 007b ss: 0068
Process insmod (pid: 4021, threadinfo=c1f3a000 task=dfad5560)
Stack: 00000000 c13e1c40 c1477754 c016f660 00000001 00000001 00000001 00000002
00000000 c01733f0 c13e1c40 00000206 00000046 c1477758 00000000 00000000
c01e2370 00000001 c01e2c0a 00002000 00000000 c1477758 00004926 c13e1c40
Call Trace:
block_read_full_page+0x2f0/0x350 blkdev_get_block+0x0/0x70
radix_tree_node_alloc+0x10/0x60 radix_tree_insert+0x1ca/0x210
add_to_page_cache+0x4b/0xc0 read_cache_page+0x91/0x170
blkdev_readpage+0x0/0x10 read_dev_sector+0x3f/0xb0
[ adfspart_check_ICS+0x0/0x210 adfspart_check_ICS+0x23/0x210
disk_name+0xb3/0xc0 adfspart_check_ICS+0x0/0x210
rescan_partitions+0x133/0x1f0 do_open+0x269/0x320
handle_IRQ_event+0x33/0x60 blkdev_get+0x6b/0x90
register_disk+0x14b/0x170 add_disk+0x36/0x50
exact_match+0x0/0x10 exact_lock+0x0/0x10
_init+0x489/0x540 [driver] sys_init_module+0x148/0x19c0
__kmalloc+0x0/0x90 sysenter_past_esp+0x54/0x79
Code: 89 d8 5b 5e 5f 5d c3 83 c4 14 31 c0 5b 5e 5f 5d c3 8d 76 00 57 56 89 ce 53 b9 01 00 00 00 89 c3 e8 ff fe ff ff 89 c7 eb 02 89 d0 <8b> 50 04 09 30 85 d2 75 f5 89 78 04 8b 43 10 83 c0 44 e8 72 de
EIP: [] create_empty_buffers+0x17/0x90 SS:ESP 0068:c1f3bbec