<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block, branch v4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.2</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-08-25T20:35:51Z</updated>
<entry>
<title>mtip32x: fix regression introduced by blk-mq per-hctx flush</title>
<updated>2015-08-25T20:35:51Z</updated>
<author>
<name>Jeff Moyer</name>
<email>jmoyer@redhat.com</email>
</author>
<published>2015-07-29T14:22:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=74c9c9134bf8d8a6d5c5683f60262eed3d6fb5ac'/>
<id>urn:sha1:74c9c9134bf8d8a6d5c5683f60262eed3d6fb5ac</id>
<content type='text'>
Hi,

After commit f70ced091707 (blk-mq: support per-distpatch_queue flush
machinery), the mtip32xx driver may oops upon module load due to walking
off the end of an array in mtip_init_cmd.  On initialization of the
flush_rq, init_request is called with request_index &gt;= the maximum queue
depth the driver supports.  For mtip32xx, this value is used to index
into an array.  What this means is that the driver will walk off the end
of the array, and either oops or cause random memory corruption.

The problem is easily reproduced by doing modprobe/rmmod of the mtip32xx
driver in a loop.  I can typically reproduce the problem in about 30
seconds.

Now, in the case of mtip32xx, it actually doesn't support flush/fua, so
I think we can simply return without doing anything.  In addition, no
other mq-enabled driver does anything with the request_index passed into
init_request(), so no other driver is affected.  However, I'm not really
sure what is expected of drivers.  Ming, what did you envision drivers
would do when initializing the flush requests?

Signed-off-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>zram: fix pool name truncation</title>
<updated>2015-08-14T22:56:32Z</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>sergey.senozhatsky@gmail.com</email>
</author>
<published>2015-08-14T22:35:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ce321f574a97f3453bca5a4117610b43dabd3ee'/>
<id>urn:sha1:4ce321f574a97f3453bca5a4117610b43dabd3ee</id>
<content type='text'>
zram_meta_alloc() constructs a pool name for zs_create_pool() call as

    snprintf(pool_name, sizeof(pool_name), "zram%d", device_id);

However, it defines pool name buffer to be only 8 bytes long (minus
trailing zero), which means that we can have only 1000 pool names: zram0
-- zram999.

With CONFIG_ZSMALLOC_STAT enabled an attempt to create a device zram1000
can fail if device zram100 already exists, because snprintf() will
truncate new pool name to zram100 and pass it debugfs_create_dir(),
causing:

  debugfs dir &lt;zram100&gt; creation failed
  zram: Error creating memory pool

... and so on.

Fix it by passing zram-&gt;disk-&gt;disk_name to zram_meta_alloc() instead of
divice_id.  We construct zram%d name earlier and keep it as a -&gt;disk_name,
no need to snprintf() it again.

Signed-off-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.dk/linux-block</title>
<updated>2015-08-13T20:44:32Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-08-13T20:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ebcbf1664cda2bb504a3c5c1ced114daf4ddf54b'/>
<id>urn:sha1:ebcbf1664cda2bb504a3c5c1ced114daf4ddf54b</id>
<content type='text'>
Pull xen block driver fixes from Jens Axboe:
 "A few small bug fixes for xen-blk{front,back} that have been sitting
  over my vacation"

* 'for-linus' of git://git.kernel.dk/linux-block:
  xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()
  xen-blkfront: don't add indirect pages to list when !feature_persistent
  xen-blkfront: introduce blkfront_gather_backend_features()
</content>
</entry>
<entry>
<title>rbd: fix copyup completion race</title>
<updated>2015-07-31T08:38:57Z</updated>
<author>
<name>Ilya Dryomov</name>
<email>idryomov@gmail.com</email>
</author>
<published>2015-07-16T14:36:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2761713d35e370fd640b5781109f753066b746c4'/>
<id>urn:sha1:2761713d35e370fd640b5781109f753066b746c4</id>
<content type='text'>
For write/discard obj_requests that involved a copyup method call, the
opcode of the first op is CEPH_OSD_OP_CALL and the -&gt;callback is
rbd_img_obj_copyup_callback().  The latter frees copyup pages, sets
-&gt;xferred and delegates to rbd_img_obj_callback(), the "normal" image
object callback, for reporting to block layer and putting refs.

rbd_osd_req_callback() however treats CEPH_OSD_OP_CALL as a trivial op,
which means obj_request is marked done in rbd_osd_trivial_callback(),
*before* -&gt;callback is invoked and rbd_img_obj_copyup_callback() has
a chance to run.  Marking obj_request done essentially means giving
rbd_img_obj_callback() a license to end it at any moment, so if another
obj_request from the same img_request is being completed concurrently,
rbd_img_obj_end_request() may very well be called on such prematurally
marked done request:

&lt;obj_request-1/2 reply&gt;
handle_reply()
  rbd_osd_req_callback()
    rbd_osd_trivial_callback()
    rbd_obj_request_complete()
    rbd_img_obj_copyup_callback()
    rbd_img_obj_callback()
                                    &lt;obj_request-2/2 reply&gt;
                                    handle_reply()
                                      rbd_osd_req_callback()
                                        rbd_osd_trivial_callback()
      for_each_obj_request(obj_request-&gt;img_request) {
        rbd_img_obj_end_request(obj_request-1/2)
        rbd_img_obj_end_request(obj_request-2/2) &lt;--
      }

Calling rbd_img_obj_end_request() on such a request leads to trouble,
in particular because its -&gt;xfferred is 0.  We report 0 to the block
layer with blk_update_request(), get back 1 for "this request has more
data in flight" and then trip on

    rbd_assert(more ^ (which == img_request-&gt;obj_request_count));

with rhs (which == ...) being 1 because rbd_img_obj_end_request() has
been called for both requests and lhs (more) being 1 because we haven't
got a chance to set -&gt;xfferred in rbd_img_obj_copyup_callback() yet.

To fix this, leverage that rbd wants to call class methods in only two
cases: one is a generic method call wrapper (obj_request is standalone)
and the other is a copyup (obj_request is part of an img_request).  So
make a dedicated handler for CEPH_OSD_OP_CALL and directly invoke
rbd_img_obj_copyup_callback() from it if obj_request is part of an
img_request, similar to how CEPH_OSD_OP_READ handler invokes
rbd_img_obj_request_read_callback().

Since rbd_img_obj_copyup_callback() is now being called from the OSD
request callback (only), it is renamed to rbd_osd_copyup_callback().

Cc: Alex Elder &lt;elder@linaro.org&gt;
Cc: stable@vger.kernel.org # 3.10+, needs backporting for &lt; 3.18
Signed-off-by: Ilya Dryomov &lt;idryomov@gmail.com&gt;
Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'stable/for-jens-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-linus</title>
<updated>2015-07-27T17:58:41Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2015-07-27T17:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e162b219ae6a64be353f254bd4ba1c9627c67749'/>
<id>urn:sha1:e162b219ae6a64be353f254bd4ba1c9627c67749</id>
<content type='text'>
Konrad writes:

"There are three bugs that have been found in the xen-blkfront (and
backend). Two of them have the stable tree CC-ed. They have been found
where an guest is migrating to a host that is missing
'feature-persistent' support (from one that has it enabled). We end up
hitting an BUG() in the driver code."
</content>
</entry>
<entry>
<title>xen-blkback: replace work_pending with work_busy in purge_persistent_gnt()</title>
<updated>2015-07-24T13:09:49Z</updated>
<author>
<name>Bob Liu</name>
<email>bob.liu@oracle.com</email>
</author>
<published>2015-07-22T06:40:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=53bc7dc004fecf39e0ba70f2f8d120a1444315d3'/>
<id>urn:sha1:53bc7dc004fecf39e0ba70f2f8d120a1444315d3</id>
<content type='text'>
The BUG_ON() in purge_persistent_gnt() will be triggered when previous purge
work haven't finished.

There is a work_pending() before this BUG_ON, but it doesn't account if the work
is still currently running.

CC: stable@vger.kernel.org
Acked-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Signed-off-by: Bob Liu &lt;bob.liu@oracle.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen-blkfront: don't add indirect pages to list when !feature_persistent</title>
<updated>2015-07-24T13:09:16Z</updated>
<author>
<name>Bob Liu</name>
<email>bob.liu@oracle.com</email>
</author>
<published>2015-07-22T06:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7b0767502b5db11cb1f0daef2d01f6d71b1192dc'/>
<id>urn:sha1:7b0767502b5db11cb1f0daef2d01f6d71b1192dc</id>
<content type='text'>
We should consider info-&gt;feature_persistent when adding indirect page to list
info-&gt;indirect_pages, else the BUG_ON() in blkif_free() would be triggered.

When we are using persistent grants the indirect_pages list
should always be empty because blkfront has pre-allocated enough
persistent pages to fill all requests on the ring.

CC: stable@vger.kernel.org
Acked-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Signed-off-by: Bob Liu &lt;bob.liu@oracle.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen-blkfront: introduce blkfront_gather_backend_features()</title>
<updated>2015-07-24T13:07:10Z</updated>
<author>
<name>Bob Liu</name>
<email>bob.liu@oracle.com</email>
</author>
<published>2015-07-22T06:40:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d50babbe300eedf33ea5b00a12c5df3a05bd96c7'/>
<id>urn:sha1:d50babbe300eedf33ea5b00a12c5df3a05bd96c7</id>
<content type='text'>
There is a bug when migrate from !feature-persistent host to feature-persistent
host, because domU still thinks new host/backend doesn't support persistent.
Dmesg like:
backed has not unmapped grant: 839
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 839

The fix is to recheck feature-persistent of new backend in blkif_recover().
See: https://lkml.org/lkml/2015/5/25/469

As Roger suggested, we can split the part of blkfront_connect that checks for
optional features, like persistent grants, indirect descriptors and
flush/barrier features to a separate function and call it from both
blkfront_connect and blkif_recover

Acked-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Signed-off-by: Bob Liu &lt;bob.liu@oracle.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
<entry>
<title>null_blk: fix use-after-free problem</title>
<updated>2015-07-22T19:30:20Z</updated>
<author>
<name>Mike Krinkin</name>
<email>krinkin.m.u@gmail.com</email>
</author>
<published>2015-07-19T06:53:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=21974061cfb3c4b0b1a83447fb5e7cdcd06e56dc'/>
<id>urn:sha1:21974061cfb3c4b0b1a83447fb5e7cdcd06e56dc</id>
<content type='text'>
end_cmd finishes request associated with nullb_cmd struct, so we
should save pointer to request_queue in a local variable before
calling end_cmd.

The problem was causes general protection fault with slab poisoning
enabled.

Fixes: 8b70f45e2eb2 ("null_blk: restart request processing on completion handler")
Tested-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Mike Krinkin &lt;krinkin.m.u@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>NVMe: Reread partitions on metadata formats</title>
<updated>2015-07-15T21:36:47Z</updated>
<author>
<name>Keith Busch</name>
<email>keith.busch@intel.com</email>
</author>
<published>2015-07-14T17:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7bee607472aa2e5a36dfe143e5a625be06125f53'/>
<id>urn:sha1:7bee607472aa2e5a36dfe143e5a625be06125f53</id>
<content type='text'>
This patch has the driver automatically reread partitions if a namespace
has a separate metadata format. Previously revalidating a disk was
sufficient to get the correct capacity set on such formatted drives,
but partitions that may exist would not have been surfaced.

Reported-by: Paul Grabinar &lt;paul.grabinar@ranbarg.com&gt;
Signed-off-by: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Tested-by: Paul Grabinar &lt;paul.grabinar@ranbarg.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
</feed>
