<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/md/bcache/super.c, branch linux-3.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-04-12T16:12:46Z</updated>
<entry>
<title>bcache: fix cache_set_flush() NULL pointer dereference on OOM</title>
<updated>2016-04-12T16:12:46Z</updated>
<author>
<name>Eric Wheeler</name>
</author>
<published>2016-03-07T23:17:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=183027f89d4bb94dbea83b28a5352e7812fa7ec8'/>
<id>urn:sha1:183027f89d4bb94dbea83b28a5352e7812fa7ec8</id>
<content type='text'>
commit f8b11260a445169989d01df75d35af0f56178f95 upstream.

When bch_cache_set_alloc() fails to kzalloc the cache_set, the
asyncronous closure handling tries to dereference a cache_set that
hadn't yet been allocated inside of cache_set_flush() which is called
by __cache_set_unregister() during cleanup.  This appears to happen only
during an OOM condition on bcache_register.

Signed-off-by: Eric Wheeler &lt;bcache@linux.ewheeler.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>bcache: unregister reboot notifier if bcache fails to unregister device</title>
<updated>2016-03-03T23:06:44Z</updated>
<author>
<name>Zheng Liu</name>
</author>
<published>2015-11-30T01:21:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=283ab75762271a457f3547a36a586568547c5aa9'/>
<id>urn:sha1:283ab75762271a457f3547a36a586568547c5aa9</id>
<content type='text'>
commit 2ecf0cdb2b437402110ab57546e02abfa68a716b upstream.

In bcache_init() function it forgot to unregister reboot notifier if
bcache fails to unregister a block device.  This commit fixes this.

Signed-off-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Tested-by: Joshua Schmid &lt;jschmid@suse.com&gt;
Tested-by: Eric Wheeler &lt;bcache@linux.ewheeler.net&gt;
Cc: Kent Overstreet &lt;kmo@daterainc.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>bcache: fix a leak in bch_cached_dev_run()</title>
<updated>2016-03-03T23:06:44Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2015-11-30T01:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dba6700e43c3ae56eb76b5013cc32500a21d0070'/>
<id>urn:sha1:dba6700e43c3ae56eb76b5013cc32500a21d0070</id>
<content type='text'>
commit 4d4d8573a8451acc9f01cbea24b7e55f04a252fe upstream.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Tested-by: Joshua Schmid &lt;jschmid@suse.com&gt;
Tested-by: Eric Wheeler &lt;bcache@linux.ewheeler.net&gt;
Cc: Kent Overstreet &lt;kmo@daterainc.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>bcache: clear BCACHE_DEV_UNLINK_DONE flag when attaching a backing device</title>
<updated>2016-03-03T23:06:44Z</updated>
<author>
<name>Zheng Liu</name>
</author>
<published>2015-11-30T01:19:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ffed442c0186bc57af0761bdc55b217681d211cf'/>
<id>urn:sha1:ffed442c0186bc57af0761bdc55b217681d211cf</id>
<content type='text'>
commit fecaee6f20ee122ad75402c53d8278f9bb142ddc upstream.

This bug can be reproduced by the following script:

  #!/bin/bash

  bcache_sysfs="/sys/fs/bcache"

  function clear_cache()
  {
  	if [ ! -e $bcache_sysfs ]; then
  		echo "no bcache sysfs"
  		exit
  	fi

  	cset_uuid=$(ls -l $bcache_sysfs|head -n 2|tail -n 1|awk '{print $9}')
  	sudo sh -c "echo $cset_uuid &gt; /sys/block/sdb/sdb1/bcache/detach"
  	sleep 5
  	sudo sh -c "echo $cset_uuid &gt; /sys/block/sdb/sdb1/bcache/attach"
  }

  for ((i=0;i&lt;10;i++)); do
  	clear_cache
  done

The warning messages look like below:
[  275.948611] ------------[ cut here ]------------
[  275.963840] WARNING: at fs/sysfs/dir.c:512 sysfs_add_one+0xb8/0xd0() (Tainted: P        W
---------------   )
[  275.979253] Hardware name: Tecal RH2285
[  275.994106] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:09.0/0000:08:00.0/host4/target4:2:1/4:2:1:0/block/sdb/sdb1/bcache/cache'
[  276.024105] Modules linked in: bcache tcp_diag inet_diag ipmi_devintf ipmi_si ipmi_msghandler
bonding 8021q garp stp llc ipv6 ext3 jbd loop sg iomemory_vsl(P) bnx2 microcode serio_raw i2c_i801
i2c_core iTCO_wdt iTCO_vendor_support i7core_edac edac_core shpchp ext4 jbd2 mbcache megaraid_sas
pata_acpi ata_generic ata_piix dm_mod [last unloaded: scsi_wait_scan]
[  276.072643] Pid: 2765, comm: sh Tainted: P        W  ---------------    2.6.32 #1
[  276.089315] Call Trace:
[  276.105801]  [&lt;ffffffff81070fe7&gt;] ? warn_slowpath_common+0x87/0xc0
[  276.122650]  [&lt;ffffffff810710d6&gt;] ? warn_slowpath_fmt+0x46/0x50
[  276.139361]  [&lt;ffffffff81205c08&gt;] ? sysfs_add_one+0xb8/0xd0
[  276.156012]  [&lt;ffffffff8120609b&gt;] ? sysfs_do_create_link+0x12b/0x170
[  276.172682]  [&lt;ffffffff81206113&gt;] ? sysfs_create_link+0x13/0x20
[  276.189282]  [&lt;ffffffffa03bda21&gt;] ? bcache_device_link+0xc1/0x110 [bcache]
[  276.205993]  [&lt;ffffffffa03bfa08&gt;] ? bch_cached_dev_attach+0x478/0x4f0 [bcache]
[  276.222794]  [&lt;ffffffffa03c4a17&gt;] ? bch_cached_dev_store+0x627/0x780 [bcache]
[  276.239680]  [&lt;ffffffff8116783a&gt;] ? alloc_pages_current+0xaa/0x110
[  276.256594]  [&lt;ffffffff81203b15&gt;] ? sysfs_write_file+0xe5/0x170
[  276.273364]  [&lt;ffffffff811887b8&gt;] ? vfs_write+0xb8/0x1a0
[  276.290133]  [&lt;ffffffff811890b1&gt;] ? sys_write+0x51/0x90
[  276.306368]  [&lt;ffffffff8100c072&gt;] ? system_call_fastpath+0x16/0x1b
[  276.322301] ---[ end trace 9f5d4fcdd0c3edfb ]---
[  276.338241] ------------[ cut here ]------------
[  276.354109] WARNING: at /home/wenqing.lz/bcache/bcache/super.c:720
bcache_device_link+0xdf/0x110 [bcache]() (Tainted: P        W  ---------------   )
[  276.386017] Hardware name: Tecal RH2285
[  276.401430] Couldn't create device &lt;-&gt; cache set symlinks
[  276.401759] Modules linked in: bcache tcp_diag inet_diag ipmi_devintf ipmi_si ipmi_msghandler
bonding 8021q garp stp llc ipv6 ext3 jbd loop sg iomemory_vsl(P) bnx2 microcode serio_raw i2c_i801
i2c_core iTCO_wdt iTCO_vendor_support i7core_edac edac_core shpchp ext4 jbd2 mbcache megaraid_sas
pata_acpi ata_generic ata_piix dm_mod [last unloaded: scsi_wait_scan]
[  276.465477] Pid: 2765, comm: sh Tainted: P        W  ---------------    2.6.32 #1
[  276.482169] Call Trace:
[  276.498610]  [&lt;ffffffff81070fe7&gt;] ? warn_slowpath_common+0x87/0xc0
[  276.515405]  [&lt;ffffffff810710d6&gt;] ? warn_slowpath_fmt+0x46/0x50
[  276.532059]  [&lt;ffffffffa03bda3f&gt;] ? bcache_device_link+0xdf/0x110 [bcache]
[  276.548808]  [&lt;ffffffffa03bfa08&gt;] ? bch_cached_dev_attach+0x478/0x4f0 [bcache]
[  276.565569]  [&lt;ffffffffa03c4a17&gt;] ? bch_cached_dev_store+0x627/0x780 [bcache]
[  276.582418]  [&lt;ffffffff8116783a&gt;] ? alloc_pages_current+0xaa/0x110
[  276.599341]  [&lt;ffffffff81203b15&gt;] ? sysfs_write_file+0xe5/0x170
[  276.616142]  [&lt;ffffffff811887b8&gt;] ? vfs_write+0xb8/0x1a0
[  276.632607]  [&lt;ffffffff811890b1&gt;] ? sys_write+0x51/0x90
[  276.648671]  [&lt;ffffffff8100c072&gt;] ? system_call_fastpath+0x16/0x1b
[  276.664756] ---[ end trace 9f5d4fcdd0c3edfc ]---

We forget to clear BCACHE_DEV_UNLINK_DONE flag in bcache_device_attach()
function when we attach a backing device first time.  After detaching this
backing device, this flag will be true and sysfs_remove_link() isn't called in
bcache_device_unlink().  Then when we attach this backing device again,
sysfs_create_link() will return EEXIST error in bcache_device_link().

So the fix is trival and we clear this flag in bcache_device_link().

Signed-off-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Tested-by: Joshua Schmid &lt;jschmid@suse.com&gt;
Tested-by: Eric Wheeler &lt;bcache@linux.ewheeler.net&gt;
Cc: Kent Overstreet &lt;kmo@daterainc.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>bcache: Convert debug code to btree_keys</title>
<updated>2014-01-08T21:05:13Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2013-12-18T07:47:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc9d98d621bdce0552997200ce855659875a5c9f'/>
<id>urn:sha1:dc9d98d621bdce0552997200ce855659875a5c9f</id>
<content type='text'>
More work to disentangle various code from struct btree

Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
<entry>
<title>bcache: Abstract out stuff needed for sorting</title>
<updated>2014-01-08T21:05:12Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2013-12-21T01:22:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65d45231b56efb3db51eb441e2c68f8252ecdd12'/>
<id>urn:sha1:65d45231b56efb3db51eb441e2c68f8252ecdd12</id>
<content type='text'>
Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
<entry>
<title>bcache: Rename/shuffle various code around</title>
<updated>2014-01-08T21:05:12Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2013-12-18T07:49:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee811287c9f241641899788cbfc9d70ed96ba3a5'/>
<id>urn:sha1:ee811287c9f241641899788cbfc9d70ed96ba3a5</id>
<content type='text'>
More work to disentangle bset.c from the rest of the code:

Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
<entry>
<title>bcache: Add struct bset_sort_state</title>
<updated>2014-01-08T21:05:12Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2013-09-11T05:53:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=67539e85289c14a76a1c4162613d14a5f05a0027'/>
<id>urn:sha1:67539e85289c14a76a1c4162613d14a5f05a0027</id>
<content type='text'>
More disentangling bset.c from the rest of the bcache code - soon, the
sorting routines won't have any dependencies on any outside structs.

Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
<entry>
<title>bcache: Use a mempool for mergesort temporary space</title>
<updated>2014-01-08T21:05:11Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2013-12-18T08:01:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a45114534766058193eb2605c136562a4f7bcc8'/>
<id>urn:sha1:0a45114534766058193eb2605c136562a4f7bcc8</id>
<content type='text'>
It was a single element mempool before, it's slightly cleaner to just use a real
mempool.

Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
<entry>
<title>bcache: Trivial error handling fix</title>
<updated>2014-01-08T21:05:10Z</updated>
<author>
<name>Kent Overstreet</name>
</author>
<published>2013-07-09T00:53:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c41c8a713da7874bd79196696a275beeb11821e'/>
<id>urn:sha1:5c41c8a713da7874bd79196696a275beeb11821e</id>
<content type='text'>
Signed-off-by: Kent Overstreet &lt;kmo@daterainc.com&gt;
</content>
</entry>
</feed>
