<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/block, branch v3.0.10</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/block?h=v3.0.10</id>
<link rel='self' href='https://git.amat.us/linux/atom/block?h=v3.0.10'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-11-21T22:31:26Z</updated>
<entry>
<title>block: Always check length of all iov entries in blk_rq_map_user_iov()</title>
<updated>2011-11-21T22:31:26Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2011-11-13T18:58:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=acc1887e7e0da5d19fb77b2a5e5c5db2d57667f9'/>
<id>urn:sha1:acc1887e7e0da5d19fb77b2a5e5c5db2d57667f9</id>
<content type='text'>
commit 6b76106d8ef31111d6fc469564b83b5f5542794f upstream.

Even after commit 5478755616ae2ef1ce144dded589b62b2a50d575
("block: check for proper length of iov entries earlier ...")
we still won't check for zero-length entries after an unaligned
entry.  Remove the break-statement, so all entries are checked.

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>block: make gendisk hold a reference to its queue</title>
<updated>2011-11-11T17:37:07Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-10-17T11:42:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f53881e6463124c910b17a5ea722a5cf5ab67fb3'/>
<id>urn:sha1:f53881e6463124c910b17a5ea722a5cf5ab67fb3</id>
<content type='text'>
commit f992ae801a7dec34a4ed99a6598bbbbfb82af4fb upstream.

The following command sequence triggers an oops.

# mount /dev/sdb1 /mnt
# echo 1 &gt; /sys/class/scsi_device/0\:0\:1\:0/device/delete
# umount /mnt

 general protection fault: 0000 [#1] PREEMPT SMP
 CPU 2
 Modules linked in:

 Pid: 791, comm: umount Not tainted 3.1.0-rc3-work+ #8 Bochs Bochs
 RIP: 0010:[&lt;ffffffff810d0879&gt;]  [&lt;ffffffff810d0879&gt;] __lock_acquire+0x389/0x1d60
...
 Call Trace:
  [&lt;ffffffff810d2845&gt;] lock_acquire+0x95/0x140
  [&lt;ffffffff81aed87b&gt;] _raw_spin_lock+0x3b/0x50
  [&lt;ffffffff811573bc&gt;] bdi_lock_two+0x5c/0x70
  [&lt;ffffffff811c2f6c&gt;] bdev_inode_switch_bdi+0x4c/0xf0
  [&lt;ffffffff811c3fcb&gt;] __blkdev_put+0x11b/0x1d0
  [&lt;ffffffff811c4010&gt;] __blkdev_put+0x160/0x1d0
  [&lt;ffffffff811c40df&gt;] blkdev_put+0x5f/0x190
  [&lt;ffffffff8118f18d&gt;] kill_block_super+0x4d/0x80
  [&lt;ffffffff8118f4a5&gt;] deactivate_locked_super+0x45/0x70
  [&lt;ffffffff8119003a&gt;] deactivate_super+0x4a/0x70
  [&lt;ffffffff811ac4ad&gt;] mntput_no_expire+0xed/0x130
  [&lt;ffffffff811acf2e&gt;] sys_umount+0x7e/0x3a0
  [&lt;ffffffff81aeeeab&gt;] system_call_fastpath+0x16/0x1b

This is because bdev holds on to disk but disk doesn't pin the
associated queue.  If a SCSI device is removed while the device is
still open, the sdev puts the base reference to the queue on release.
When the bdev is finally released, the associated queue is already
gone along with the bdi and bdev_inode_switch_bdi() ends up
dereferencing already freed bdi.

Even if it were not for this bug, disk not holding onto the associated
queue is very unusual and error-prone.

Fix it by making add_disk() take an extra reference to its queue and
put it on disk_release() and ensuring that disk and its fops owner are
put in that order after all accesses to the disk and queue are
complete.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>block: Free queue resources at blk_release_queue()</title>
<updated>2011-10-03T18:41:13Z</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@suse.de</email>
</author>
<published>2011-09-28T14:07:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c2b387f0295ffaeb5e96f0d6f745fde507abd651'/>
<id>urn:sha1:c2b387f0295ffaeb5e96f0d6f745fde507abd651</id>
<content type='text'>
commit 777eb1bf15b8532c396821774bf6451e563438f5 upstream.

A kernel crash is observed when a mounted ext3/ext4 filesystem is
physically removed. The problem is that blk_cleanup_queue() frees up
some resources eg by calling elevator_exit(), which are not checked for
in normal operation. So we should rather move these calls to the
destructor function blk_release_queue() as at that point all remaining
references are gone. However, in doing so we have to ensure that any
externally supplied queue_lock is disconnected as the driver might free
up the lock after the call of blk_cleanup_queue(),

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>blk-cgroup: be able to remove the record of unplugged device</title>
<updated>2011-10-03T18:40:42Z</updated>
<author>
<name>Wanlong Gao</name>
<email>gaowanlong@cn.fujitsu.com</email>
</author>
<published>2011-09-21T08:22:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e37143e6522a978b62ed4142741236af1f381d1d'/>
<id>urn:sha1:e37143e6522a978b62ed4142741236af1f381d1d</id>
<content type='text'>
commit d11bb4462c4cc6ddd45c6927c617ad79fa6fb8fc upstream.

The bug is we're not able to remove the device from blkio cgroup's
per-device control files if it gets unplugged.

To reproduce the bug:

  # mount -t cgroup -o blkio xxx /cgroup
  # cd /cgroup
  # echo "8:0 1000" &gt; blkio.throttle.read_bps_device
  # unplug the device
  # cat blkio.throttle.read_bps_device
  8:0	1000
  # echo "8:0 0" &gt; blkio.throttle.read_bps_device
  -bash: echo: write error: No such device

After patching, the device removal will succeed.

Thanks for the comments of Paul, Zefan, and Vivek.

Signed-off-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Paul Menage &lt;paul@paulmenage.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>fix crash in scsi_dispatch_cmd()</title>
<updated>2011-08-05T04:58:36Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2011-07-07T20:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1768e0b7e77b5c3e11cd0f0ab15358ccba3a9880'/>
<id>urn:sha1:1768e0b7e77b5c3e11cd0f0ab15358ccba3a9880</id>
<content type='text'>
commit bfe159a51203c15d23cb3158fffdc25ec4b4dda1 upstream.

USB surprise removal of sr is triggering an oops in
scsi_dispatch_command().  What seems to be happening is that USB is
hanging on to a queue reference until the last close of the upper
device, so the crash is caused by surprise remove of a mounted CD
followed by attempted unmount.

The problem is that USB doesn't issue its final commands as part of
the SCSI teardown path, but on last close when the block queue is long
gone.  The long term fix is probably to make sr do the teardown in the
same way as sd (so remove all the lower bits on ejection, but keep the
upper disk alive until last close of user space).  However, the
current oops can be simply fixed by not allowing any commands to be
sent to a dead queue.

Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>cfq-iosched: make code consistent</title>
<updated>2011-06-27T07:36:06Z</updated>
<author>
<name>Shaohua Li</name>
<email>shaohua.li@intel.com</email>
</author>
<published>2011-06-27T07:03:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=726e99ab88db059fe1422e15376ae404f8c66eb4'/>
<id>urn:sha1:726e99ab88db059fe1422e15376ae404f8c66eb4</id>
<content type='text'>
ioc-&gt;ioc_data is rcu protectd, so uses correct API to access it.
This doesn't change any behavior, but just make code consistent.

Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: stable@kernel.org # after ab4bd22d
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>cfq-iosched: fix a rcu warning</title>
<updated>2011-06-27T07:36:06Z</updated>
<author>
<name>Shaohua Li</name>
<email>shaohua.li@intel.com</email>
</author>
<published>2011-06-27T07:03:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3181faa85bda3dc3f5e630a1846526c9caaa38e3'/>
<id>urn:sha1:3181faa85bda3dc3f5e630a1846526c9caaa38e3</id>
<content type='text'>
I got a rcu warnning at boot. the ioc-&gt;ioc_data is rcu_deferenced, but
doesn't hold rcu_read_lock.

Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: stable@kernel.org # after ab4bd22d
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: Add __attribute__((format(printf...) and fix fallout</title>
<updated>2011-06-13T08:42:49Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2011-06-13T08:42:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=08e8138adebdd511e0955e8d6c051904bb4082af'/>
<id>urn:sha1:08e8138adebdd511e0955e8d6c051904bb4082af</id>
<content type='text'>
Use the compiler to verify format strings and arguments.

Fix fallout.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: make disk_block_events() properly wait for work cancellation</title>
<updated>2011-06-09T18:43:59Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-06-09T18:43:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fdd514e16bb2531c0c61ae8a1f87740ce217f630'/>
<id>urn:sha1:fdd514e16bb2531c0c61ae8a1f87740ce217f630</id>
<content type='text'>
disk_block_events() should guarantee that the event work is not in
flight on return and once blocked it shouldn't issue further
cancellations.

Because there was no synchronization between the first blocker doing
cancel_delayed_work_sync() and the following blockers, the following
blockers could finish before cancellation was complete, which broke
both guarantees - event work could be in flight and cancellation could
happen after return.

This bug triggered WARN_ON_ONCE() in disk_clear_events() reported in
bug#34662.

  https://bugzilla.kernel.org/show_bug.cgi?id=34662

Fix it by adding an outer mutex which protects both block count
manipulation and work cancellation.

-v2: Use outer mutex instead of bit waitqueue per Linus.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Tested-by: Sitsofe Wheeler &lt;sitsofe@yahoo.com&gt;
Reported-by: Sitsofe Wheeler &lt;sitsofe@yahoo.com&gt;
Reported-by: Borislav Petkov &lt;bp@alien8.de&gt;
Reported-by: Meelis Roos &lt;mroos@linux.ee&gt;
Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: remove non-syncing __disk_block_events() and fold it into disk_block_events()</title>
<updated>2011-06-09T18:43:55Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-06-09T18:43:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c3af54afbac3675337cedf326b7b127ffa7f7327'/>
<id>urn:sha1:c3af54afbac3675337cedf326b7b127ffa7f7327</id>
<content type='text'>
After the previous update to disk_check_events(), nobody is using
non-syncing __disk_block_events().  Remove @sync and, as this makes
__disk_block_events() virtually identical to disk_block_events(),
remove the underscore prefixed version.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
</feed>
