Skip to contentSkip to conversation

kernel 3.10 + applied bcache patches unable to handle kernel NULL pointer dereference

DISCUSSION Stefan Priebe - Profihost AG 2 participants 9 messages Jul 4, 2013 – Jul 12, 2013 6 messages not in the archive bcache (block layer cache)

lore
Share & tools
lore
#0 lore raw

Hello list,

after applying the latest patches from the bcache branch on top of kernel 3.10.

I get the following backtrace while booting my system.

 BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
 IP: [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 PGD c44e83067 PUD c45480067 PMD 0
 SMP
 usb 2-1: new high-speed USB device number 2 using ehci-pci
 Modules linked in: bcache sd_mod ahci ehci_pci libahci ehci_hcd isci(+)
libsas usbcore igb usb_common scsi_transport_
sas i2c_algo_bit i2c_core ptp pps_core ixgbe(O+)
 CPU: 1 PID: 381 Comm: bcache-register Tainted: G           O 3.10.0+2-ph #1
 Hardware name: Supermicro
X9SRE/X9SRE-3F/X9SRi/X9SRi-3F/X9SRE/X9SRE-3F/X9SRi/X9SRi-3F, BIOS 2.0a
04/19/2013
 task: ffff880c476bcaa0 ti: ffff880c44544000 task.ti: ffff880c44544000
 RIP: 0010:[<ffffffffa00fbe07>]  [<ffffffffa00fbe07>]
bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 RSP: 0018:ffff880c44545850  EFLAGS: 00010246
 RAX: 00000000fffffff8 RBX: ffff880c437464d0 RCX: ffff880c43ef0000
 RDX: 000000001d1c1810 RSI: 0000000000000001 RDI: ffff880c43ee0000
 RBP: ffff880c44545858 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000001 R12: ffff880c44545c70
 R13: ffff880c44545c08 R14: ffff880c43aa9000 R15: ffff880c44545968
 FS:  00007f545ab31700(0000) GS:ffff880c7fc20000(0000)

knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000000a0 CR3: 0000000c457bf000 CR4: 00000000000407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400

 Stack:
  ffff880c437464d0 ffff880c44545948 ffffffffa00f204d 0000000000000013
  ffff880c445459c0 0000000000000010 ffff880c44545968 0000000000000008
  0000000000000001 0000000000000001 8000000000000001 0000000000000008
 Call Trace:
  [<ffffffffa00f204d>] fix_overlapping_extents+0x2ed/0x620 [bcache]
  [<ffffffffa00f6f47>] ? __bch_bset_search+0xa7/0x260 [bcache]
  [<ffffffffa00f7cff>] ? __bch_btree_iter_init+0x7f/0xd0 [bcache]
  [<ffffffffa00f2464>] btree_insert_key+0xe4/0x410 [bcache]
  [<ffffffffa00f2a37>] bch_btree_insert_keys+0xc7/0xf0 [bcache]
  [<ffffffffa00f545f>] bch_btree_insert_recurse+0xbf/0x530 [bcache]
  [<ffffffffa00f5a19>] bch_btree_insert+0x149/0x320 [bcache]
  [<ffffffffa00fb1fd>] bch_journal_replay+0x15d/0x2a0 [bcache]
  [<ffffffffa01057d9>] run_cache_set+0x2e9/0x5e0 [bcache]
  [<ffffffffa01061cf>] register_cache_set+0x20f/0x2d0 [bcache]
  [<ffffffffa0103a61>] ? cache_alloc+0x4e1/0x500 [bcache]
  [<ffffffffa0106377>] register_cache+0xe7/0x190 [bcache]
  [<ffffffffa010660e>] register_bcache+0x1ee/0x320 [bcache]
  [<ffffffff8129e717>] kobj_attr_store+0x17/0x20
  [<ffffffff811af36d>] sysfs_write_file+0xdd/0x160
  [<ffffffff8114039f>] vfs_write+0xdf/0x1a0
  [<ffffffff811408ea>] SyS_write+0x5a/0xa0
  [<ffffffff81525e52>] system_call_fastpath+0x16/0x1b
 Code: 00 00 00 00 b8 01 00 00 00 c9 c3 66 0f 1f 84 00 00 00 00 00 55 89

c8 89 f6 48 89 e5 53 48 8b 8f c8 0c 00 00 4c
8b 04 f1 4d 85 c0 <41> 8b 88 a0 00 00 00 74 60 85 c0 74 5c bf 01 00 00 00 d3 e7 8d
RIP [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
RSP <ffff880c44545850>
CR2: 00000000000000a0

 ---[ end trace 052fb8ed913f5457 ]---

Greets,
Stefan

A message that is not in the archive (sent off-list or not yet received): 51D542EB.7070404-2Lf/[email protected]

#2 lore raw

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Am 04.07.2013 11:39, schrieb Stefan Priebe - Profihost AG:

Quoted 70 lines

Hello list,

after applying the latest patches from the bcache branch on top of kernel 3.10.

I get the following backtrace while booting my system.

 BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
 IP: [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 PGD c44e83067 PUD c45480067 PMD 0
 SMP
 usb 2-1: new high-speed USB device number 2 using ehci-pci
 Modules linked in: bcache sd_mod ahci ehci_pci libahci ehci_hcd isci(+)
libsas usbcore igb usb_common scsi_transport_
sas i2c_algo_bit i2c_core ptp pps_core ixgbe(O+)
 CPU: 1 PID: 381 Comm: bcache-register Tainted: G           O 3.10.0+2-ph #1
 Hardware name: Supermicro
X9SRE/X9SRE-3F/X9SRi/X9SRi-3F/X9SRE/X9SRE-3F/X9SRi/X9SRi-3F, BIOS 2.0a
04/19/2013
 task: ffff880c476bcaa0 ti: ffff880c44544000 task.ti: ffff880c44544000
 RIP: 0010:[<ffffffffa00fbe07>]  [<ffffffffa00fbe07>]
bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 RSP: 0018:ffff880c44545850  EFLAGS: 00010246
 RAX: 00000000fffffff8 RBX: ffff880c437464d0 RCX: ffff880c43ef0000
 RDX: 000000001d1c1810 RSI: 0000000000000001 RDI: ffff880c43ee0000
 RBP: ffff880c44545858 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000001 R12: ffff880c44545c70
 R13: ffff880c44545c08 R14: ffff880c43aa9000 R15: ffff880c44545968
 FS:  00007f545ab31700(0000) GS:ffff880c7fc20000(0000)

knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000000a0 CR3: 0000000c457bf000 CR4: 00000000000407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400

 Stack:
  ffff880c437464d0 ffff880c44545948 ffffffffa00f204d 0000000000000013
  ffff880c445459c0 0000000000000010 ffff880c44545968 0000000000000008
  0000000000000001 0000000000000001 8000000000000001 0000000000000008
 Call Trace:
  [<ffffffffa00f204d>] fix_overlapping_extents+0x2ed/0x620 [bcache]
  [<ffffffffa00f6f47>] ? __bch_bset_search+0xa7/0x260 [bcache]
  [<ffffffffa00f7cff>] ? __bch_btree_iter_init+0x7f/0xd0 [bcache]
  [<ffffffffa00f2464>] btree_insert_key+0xe4/0x410 [bcache]
  [<ffffffffa00f2a37>] bch_btree_insert_keys+0xc7/0xf0 [bcache]
  [<ffffffffa00f545f>] bch_btree_insert_recurse+0xbf/0x530 [bcache]
  [<ffffffffa00f5a19>] bch_btree_insert+0x149/0x320 [bcache]
  [<ffffffffa00fb1fd>] bch_journal_replay+0x15d/0x2a0 [bcache]
  [<ffffffffa01057d9>] run_cache_set+0x2e9/0x5e0 [bcache]
  [<ffffffffa01061cf>] register_cache_set+0x20f/0x2d0 [bcache]
  [<ffffffffa0103a61>] ? cache_alloc+0x4e1/0x500 [bcache]
  [<ffffffffa0106377>] register_cache+0xe7/0x190 [bcache]
  [<ffffffffa010660e>] register_bcache+0x1ee/0x320 [bcache]
  [<ffffffff8129e717>] kobj_attr_store+0x17/0x20
  [<ffffffff811af36d>] sysfs_write_file+0xdd/0x160
  [<ffffffff8114039f>] vfs_write+0xdf/0x1a0
  [<ffffffff811408ea>] SyS_write+0x5a/0xa0
  [<ffffffff81525e52>] system_call_fastpath+0x16/0x1b
 Code: 00 00 00 00 b8 01 00 00 00 c9 c3 66 0f 1f 84 00 00 00 00 00 55 89

c8 89 f6 48 89 e5 53 48 8b 8f c8 0c 00 00 4c
8b 04 f1 4d 85 c0 <41> 8b 88 a0 00 00 00 74 60 85 c0 74 5c bf 01 00 00 00 d3 e7 8d
RIP [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
RSP <ffff880c44545850>
CR2: 00000000000000a0

 ---[ end trace 052fb8ed913f5457 ]---

Greets,
Stefan

A message that is not in the archive (sent off-list or not yet received): 51D56066.80106-2Lf/[email protected]

#4 lore raw
Quoted 1 line · Stefan Priebe - Profihost AG

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Oh I see, the patch that introduced this is an old version of the patch
- the bcache-for-3.11 had this fixed, and I forgot to update that branch. Thanks, I'll apply it there.

Quoted 76 lines

Am 04.07.2013 11:39, schrieb Stefan Priebe - Profihost AG:

Quoted 65 lines

Hello list,

after applying the latest patches from the bcache branch on top of kernel 3.10.

I get the following backtrace while booting my system.

 BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
 IP: [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 PGD c44e83067 PUD c45480067 PMD 0
 SMP
 usb 2-1: new high-speed USB device number 2 using ehci-pci
 Modules linked in: bcache sd_mod ahci ehci_pci libahci ehci_hcd isci(+)
libsas usbcore igb usb_common scsi_transport_
sas i2c_algo_bit i2c_core ptp pps_core ixgbe(O+)
 CPU: 1 PID: 381 Comm: bcache-register Tainted: G           O 3.10.0+2-ph #1
 Hardware name: Supermicro
X9SRE/X9SRE-3F/X9SRi/X9SRi-3F/X9SRE/X9SRE-3F/X9SRi/X9SRi-3F, BIOS 2.0a
04/19/2013
 task: ffff880c476bcaa0 ti: ffff880c44544000 task.ti: ffff880c44544000
 RIP: 0010:[<ffffffffa00fbe07>]  [<ffffffffa00fbe07>]
bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 RSP: 0018:ffff880c44545850  EFLAGS: 00010246
 RAX: 00000000fffffff8 RBX: ffff880c437464d0 RCX: ffff880c43ef0000
 RDX: 000000001d1c1810 RSI: 0000000000000001 RDI: ffff880c43ee0000
 RBP: ffff880c44545858 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000001 R12: ffff880c44545c70
 R13: ffff880c44545c08 R14: ffff880c43aa9000 R15: ffff880c44545968
 FS:  00007f545ab31700(0000) GS:ffff880c7fc20000(0000)

knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000000a0 CR3: 0000000c457bf000 CR4: 00000000000407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400

 Stack:
  ffff880c437464d0 ffff880c44545948 ffffffffa00f204d 0000000000000013
  ffff880c445459c0 0000000000000010 ffff880c44545968 0000000000000008
  0000000000000001 0000000000000001 8000000000000001 0000000000000008
 Call Trace:
  [<ffffffffa00f204d>] fix_overlapping_extents+0x2ed/0x620 [bcache]
  [<ffffffffa00f6f47>] ? __bch_bset_search+0xa7/0x260 [bcache]
  [<ffffffffa00f7cff>] ? __bch_btree_iter_init+0x7f/0xd0 [bcache]
  [<ffffffffa00f2464>] btree_insert_key+0xe4/0x410 [bcache]
  [<ffffffffa00f2a37>] bch_btree_insert_keys+0xc7/0xf0 [bcache]
  [<ffffffffa00f545f>] bch_btree_insert_recurse+0xbf/0x530 [bcache]
  [<ffffffffa00f5a19>] bch_btree_insert+0x149/0x320 [bcache]
  [<ffffffffa00fb1fd>] bch_journal_replay+0x15d/0x2a0 [bcache]
  [<ffffffffa01057d9>] run_cache_set+0x2e9/0x5e0 [bcache]
  [<ffffffffa01061cf>] register_cache_set+0x20f/0x2d0 [bcache]
  [<ffffffffa0103a61>] ? cache_alloc+0x4e1/0x500 [bcache]
  [<ffffffffa0106377>] register_cache+0xe7/0x190 [bcache]
  [<ffffffffa010660e>] register_bcache+0x1ee/0x320 [bcache]
  [<ffffffff8129e717>] kobj_attr_store+0x17/0x20
  [<ffffffff811af36d>] sysfs_write_file+0xdd/0x160
  [<ffffffff8114039f>] vfs_write+0xdf/0x1a0
  [<ffffffff811408ea>] SyS_write+0x5a/0xa0
  [<ffffffff81525e52>] system_call_fastpath+0x16/0x1b
 Code: 00 00 00 00 b8 01 00 00 00 c9 c3 66 0f 1f 84 00 00 00 00 00 55 89

c8 89 f6 48 89 e5 53 48 8b 8f c8 0c 00 00 4c
8b 04 f1 4d 85 c0 <41> 8b 88 a0 00 00 00 74 60 85 c0 74 5c bf 01 00 00 00 d3 e7 8d
RIP [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
RSP <ffff880c44545850>
CR2: 00000000000000a0

Quoted 5 lines
 ---[ end trace 052fb8ed913f5457 ]---

Greets,
Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

Am 12.07.2013 03:40, schrieb Kent Overstreet:

Quoted 6 lines · Stefan Priebe - Profihost AG
Quoted 1 line

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Oh I see, the patch that introduced this is an old version of the patch
- the bcache-for-3.11 had this fixed, and I forgot to update that branch. Thanks, I'll apply it there.

thanks - which commit id is the fix in? i can't find it.

Thanks.

Stefan

Quoted 76 lines
Quoted 76 lines

Am 04.07.2013 11:39, schrieb Stefan Priebe - Profihost AG:

Quoted 65 lines

Hello list,

after applying the latest patches from the bcache branch on top of kernel 3.10.

I get the following backtrace while booting my system.

 BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
 IP: [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 PGD c44e83067 PUD c45480067 PMD 0
 SMP
 usb 2-1: new high-speed USB device number 2 using ehci-pci
 Modules linked in: bcache sd_mod ahci ehci_pci libahci ehci_hcd isci(+)
libsas usbcore igb usb_common scsi_transport_
sas i2c_algo_bit i2c_core ptp pps_core ixgbe(O+)
 CPU: 1 PID: 381 Comm: bcache-register Tainted: G           O 3.10.0+2-ph #1
 Hardware name: Supermicro
X9SRE/X9SRE-3F/X9SRi/X9SRi-3F/X9SRE/X9SRE-3F/X9SRi/X9SRi-3F, BIOS 2.0a
04/19/2013
 task: ffff880c476bcaa0 ti: ffff880c44544000 task.ti: ffff880c44544000
 RIP: 0010:[<ffffffffa00fbe07>]  [<ffffffffa00fbe07>]
bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
 RSP: 0018:ffff880c44545850  EFLAGS: 00010246
 RAX: 00000000fffffff8 RBX: ffff880c437464d0 RCX: ffff880c43ef0000
 RDX: 000000001d1c1810 RSI: 0000000000000001 RDI: ffff880c43ee0000
 RBP: ffff880c44545858 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000001 R12: ffff880c44545c70
 R13: ffff880c44545c08 R14: ffff880c43aa9000 R15: ffff880c44545968
 FS:  00007f545ab31700(0000) GS:ffff880c7fc20000(0000)

knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000000a0 CR3: 0000000c457bf000 CR4: 00000000000407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400

 Stack:
  ffff880c437464d0 ffff880c44545948 ffffffffa00f204d 0000000000000013
  ffff880c445459c0 0000000000000010 ffff880c44545968 0000000000000008
  0000000000000001 0000000000000001 8000000000000001 0000000000000008
 Call Trace:
  [<ffffffffa00f204d>] fix_overlapping_extents+0x2ed/0x620 [bcache]
  [<ffffffffa00f6f47>] ? __bch_bset_search+0xa7/0x260 [bcache]
  [<ffffffffa00f7cff>] ? __bch_btree_iter_init+0x7f/0xd0 [bcache]
  [<ffffffffa00f2464>] btree_insert_key+0xe4/0x410 [bcache]
  [<ffffffffa00f2a37>] bch_btree_insert_keys+0xc7/0xf0 [bcache]
  [<ffffffffa00f545f>] bch_btree_insert_recurse+0xbf/0x530 [bcache]
  [<ffffffffa00f5a19>] bch_btree_insert+0x149/0x320 [bcache]
  [<ffffffffa00fb1fd>] bch_journal_replay+0x15d/0x2a0 [bcache]
  [<ffffffffa01057d9>] run_cache_set+0x2e9/0x5e0 [bcache]
  [<ffffffffa01061cf>] register_cache_set+0x20f/0x2d0 [bcache]
  [<ffffffffa0103a61>] ? cache_alloc+0x4e1/0x500 [bcache]
  [<ffffffffa0106377>] register_cache+0xe7/0x190 [bcache]
  [<ffffffffa010660e>] register_bcache+0x1ee/0x320 [bcache]
  [<ffffffff8129e717>] kobj_attr_store+0x17/0x20
  [<ffffffff811af36d>] sysfs_write_file+0xdd/0x160
  [<ffffffff8114039f>] vfs_write+0xdf/0x1a0
  [<ffffffff811408ea>] SyS_write+0x5a/0xa0
  [<ffffffff81525e52>] system_call_fastpath+0x16/0x1b
 Code: 00 00 00 00 b8 01 00 00 00 c9 c3 66 0f 1f 84 00 00 00 00 00 55 89

c8 89 f6 48 89 e5 53 48 8b 8f c8 0c 00 00 4c
8b 04 f1 4d 85 c0 <41> 8b 88 a0 00 00 00 74 60 85 c0 74 5c bf 01 00 00 00 d3 e7 8d
RIP [<ffffffffa00fbe07>] bcache_dev_sectors_dirty_add+0x17/0x90 [bcache]
RSP <ffff880c44545850>
CR2: 00000000000000a0

Quoted 5 lines
 ---[ end trace 052fb8ed913f5457 ]---

Greets,
Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 51DF9E21.3060601-2Lf/[email protected]

#7 lore raw
Quoted 9 lines · Stefan Priebe - Profihost AG

Am 12.07.2013 03:40, schrieb Kent Overstreet:

Quoted 6 lines · Stefan Priebe - Profihost AG
Quoted 1 line

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Oh I see, the patch that introduced this is an old version of the patch
- the bcache-for-3.11 had this fixed, and I forgot to update that branch. Thanks, I'll apply it there.

thanks - which commit id is the fix in? i can't find it.

The patch that introduced it wasn't ever destined for 3.10 anyways, and I just deleted the bcache/bcache-3.9 branches because they'd gotten out of sync and weren't getting updated with bcache-dev/bcache-for-3.11.

So just stick with bcache-for-3.10, I just backported all the important bugfixes to it - I'll be sending that stuff to Greg K-H for 3.10.1 in the next couple days too.

#8 lore raw

Am 12.07.2013 10:19, schrieb Kent Overstreet:

Quoted 9 lines · Stefan Priebe - Profihost AG
Quoted 8 lines

Am 12.07.2013 03:40, schrieb Kent Overstreet:

Quoted 6 lines · Stefan Priebe - Profihost AG
Quoted 1 line

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Oh I see, the patch that introduced this is an old version of the patch
- the bcache-for-3.11 had this fixed, and I forgot to update that branch. Thanks, I'll apply it there.

Quoted 5 lines
Quoted 1 line

thanks - which commit id is the fix in? i can't find it.

The patch that introduced it wasn't ever destined for 3.10 anyways, and I just deleted the bcache/bcache-3.9 branches because they'd gotten out of sync and weren't getting updated with bcache-dev/bcache-for-3.11.

Thanks!

Quoted 3 lines

So just stick with bcache-for-3.10, I just backported all the important bugfixes to it - I'll be sending that stuff to Greg K-H for 3.10.1 in the next couple days too.

Thanks!

Stefan

A message that is not in the archive (sent off-list or not yet received): 51DFBEEF.3020106-2Lf/[email protected]

#10 lore raw

Does not seem to build:
CC [M] drivers/md/bcache/request.o
drivers/md/bcache/request.c: In function ‘request_write’:
drivers/md/bcache/request.c:1057: error: too few arguments to function ‘bch_writeback_add’
make[3]: *** [drivers/md/bcache/request.o] Error 1
make[2]: *** [drivers/md/bcache] Error 2

Am 12.07.2013 10:31, schrieb Stefan Priebe - Profihost AG:

Quoted 25 lines

Am 12.07.2013 10:19, schrieb Kent Overstreet:

Quoted 9 lines · Stefan Priebe - Profihost AG
Quoted 8 lines

Am 12.07.2013 03:40, schrieb Kent Overstreet:

Quoted 6 lines · Stefan Priebe - Profihost AG
Quoted 1 line

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Oh I see, the patch that introduced this is an old version of the patch
- the bcache-for-3.11 had this fixed, and I forgot to update that branch. Thanks, I'll apply it there.

Quoted 5 lines
Quoted 1 line

thanks - which commit id is the fix in? i can't find it.

The patch that introduced it wasn't ever destined for 3.10 anyways, and I just deleted the bcache/bcache-3.9 branches because they'd gotten out of sync and weren't getting updated with bcache-dev/bcache-for-3.11.

Thanks!

Quoted 3 lines

So just stick with bcache-for-3.10, I just backported all the important bugfixes to it - I'll be sending that stuff to Greg K-H for 3.10.1 in the next couple days too.

Thanks!

Stefan

A message that is not in the archive (sent off-list or not yet received): 51DFC087.4080402-2Lf/[email protected]

#12 lore raw

it's this one:
- bch_writeback_add(dc, bio_sectors(bio));
+ bch_writeback_add(dc);

from cache: FUA fixes

Journal writes need to be marked FUA, not just REQ_FLUSH. And btree node writes have... weird ordering requirements.

in 3.10 bch_writeback_add still needs to arguments.

Stefan

Am 12.07.2013 10:38, schrieb Stefan Priebe - Profihost AG:

Quoted 34 lines

Does not seem to build:
CC [M] drivers/md/bcache/request.o
drivers/md/bcache/request.c: In function ‘request_write’:
drivers/md/bcache/request.c:1057: error: too few arguments to function ‘bch_writeback_add’
make[3]: *** [drivers/md/bcache/request.o] Error 1
make[2]: *** [drivers/md/bcache] Error 2

Am 12.07.2013 10:31, schrieb Stefan Priebe - Profihost AG:

Quoted 25 lines

Am 12.07.2013 10:19, schrieb Kent Overstreet:

Quoted 9 lines · Stefan Priebe - Profihost AG
Quoted 8 lines

Am 12.07.2013 03:40, schrieb Kent Overstreet:

Quoted 6 lines · Stefan Priebe - Profihost AG
Quoted 1 line

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Oh I see, the patch that introduced this is an old version of the patch
- the bcache-for-3.11 had this fixed, and I forgot to update that branch. Thanks, I'll apply it there.

Quoted 5 lines
Quoted 1 line

thanks - which commit id is the fix in? i can't find it.

The patch that introduced it wasn't ever destined for 3.10 anyways, and I just deleted the bcache/bcache-3.9 branches because they'd gotten out of sync and weren't getting updated with bcache-dev/bcache-for-3.11.

Thanks!

Quoted 3 lines

So just stick with bcache-for-3.10, I just backported all the important bugfixes to it - I'll be sending that stuff to Greg K-H for 3.10.1 in the next couple days too.

Thanks!

Stefan

A message that is not in the archive (sent off-list or not yet received): 51DFC16D.60607-2Lf/[email protected]

#14 lore raw

This one was the working commit for 3.10:

From 023d8db36affa2489a83052dbb7c969d0941f06f Mon Sep 17 00:00:00 2001
From: Kent Overstreet <[email protected]>
Date: Wed, 26 Jun 2013 17:25:38 -0700
Subject: [PATCH 17/17] bcache: FUA fixes

Journal writes need to be marked FUA, not just REQ_FLUSH. And btree node writes have... weird ordering requirements.

---
 drivers/md/bcache/btree.c   |   19 +++++++++++++++++--
 drivers/md/bcache/journal.c |    2 +-
 2 files changed, 18 insertions(+), 3 deletions(-)
drivers/md/bcache/btree.c +4 -2
index 09fb8a2..803af59 100644
@@ -328,10 +328,25 @@ static void do_btree_node_write(struct btree *b)
 
        b->bio->bi_end_io       = btree_node_write_endio;
        b->bio->bi_private      = &b->io.cl;
-       b->bio->bi_rw   = REQ_META|WRITE_SYNC;
-       b->bio->bi_size = set_blocks(i, b->c) * block_bytes(b->c);
+       b->bio->bi_rw           = REQ_META|WRITE_SYNC|REQ_FUA;
+       b->bio->bi_size         = set_blocks(i, b->c) * block_bytes(b->c);
        bch_bio_map(b->bio, i);
 
+       /*
+        * If we're appending to a leaf node, we don't technically need

FUA -
+ * this write just needs to be persisted before the next journal
write,

+        * which will be marked FLUSH|FUA.
+        *
+        * Similarly if we're writing a new btree root - the pointer is
going to
+        * be in the next journal entry.
+        *
+        * But if we're writing a new btree node (that isn't a root) or
+        * appending to a non leaf btree node, we need either FUA or a flush
+        * when we write the parent with the new pointer. FUA is cheaper

than a
+ * flush, and writes appending to leaf nodes aren't blocking
anything so
+ * just make all btree node writes FUA to keep things sane.
+ */
+

        bkey_copy(&k.key, &b->key);
        SET_PTR_OFFSET(&k.key, 0, PTR_OFFSET(&k.key, 0) + bset_offset(b,

i));

drivers/md/bcache/journal.c +1 -1
index 5ca2214..4b25066 100644
@@ -620,7 +620,7 @@ static void journal_write_unlocked(struct closure *cl)
                bio_reset(bio);
                bio->bi_sector  = PTR_OFFSET(k, i);
                bio->bi_bdev    = ca->bdev;
-               bio->bi_rw      = REQ_WRITE|REQ_SYNC|REQ_META|REQ_FLUSH;
+               bio->bi_rw      =
REQ_WRITE|REQ_SYNC|REQ_META|REQ_FLUSH|REQ_FUA;
                bio->bi_size    = sectors << 9;

                bio->bi_end_io  = journal_write_endio;
Signature · 5 lines
1.7.10.4

Stefan

Am 12.07.2013 10:42, schrieb Stefan Priebe - Profihost AG:
Quoted 48 lines

it's this one:

(quoted diff) +1 -1
-               bch_writeback_add(dc, bio_sectors(bio));
+               bch_writeback_add(dc);

from cache: FUA fixes

Journal writes need to be marked FUA, not just REQ_FLUSH. And btree node writes have... weird ordering requirements.

in 3.10 bch_writeback_add still needs to arguments.

Stefan

Am 12.07.2013 10:38, schrieb Stefan Priebe - Profihost AG:

Quoted 34 lines

Does not seem to build:
CC [M] drivers/md/bcache/request.o
drivers/md/bcache/request.c: In function ‘request_write’:
drivers/md/bcache/request.c:1057: error: too few arguments to function ‘bch_writeback_add’
make[3]: *** [drivers/md/bcache/request.o] Error 1
make[2]: *** [drivers/md/bcache] Error 2

Am 12.07.2013 10:31, schrieb Stefan Priebe - Profihost AG:

Quoted 25 lines

Am 12.07.2013 10:19, schrieb Kent Overstreet:

Quoted 9 lines · Stefan Priebe - Profihost AG
Quoted 8 lines

Am 12.07.2013 03:40, schrieb Kent Overstreet:

Quoted 6 lines · Stefan Priebe - Profihost AG
Quoted 1 line

fix is this one: http://pastebin.com/raw.php?i=LBFJRvEt

Oh I see, the patch that introduced this is an old version of the patch
- the bcache-for-3.11 had this fixed, and I forgot to update that branch. Thanks, I'll apply it there.

Quoted 5 lines
Quoted 1 line

thanks - which commit id is the fix in? i can't find it.

The patch that introduced it wasn't ever destined for 3.10 anyways, and I just deleted the bcache/bcache-3.9 branches because they'd gotten out of sync and weren't getting updated with bcache-dev/bcache-for-3.11.

Thanks!

Quoted 3 lines

So just stick with bcache-for-3.10, I just backported all the important bugfixes to it - I'll be sending that stuff to Greg K-H for 3.10.1 in the next couple days too.

Thanks!

Stefan