<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/block, branch v2.6.26</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=v2.6.26</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.26'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2008-07-12T15:14:56Z</updated>
<entry>
<title>[SCSI] bsg: fix oops on remove</title>
<updated>2008-07-12T15:14:56Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2008-07-07T20:50:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8df5fc042c8e7c08dc438c8198b62407ee1e91a0'/>
<id>urn:sha1:8df5fc042c8e7c08dc438c8198b62407ee1e91a0</id>
<content type='text'>
If you do a modremove of any sas driver, you run into an oops on
shutdown when the host is removed (coming from the host bsg device).
The root cause seems to be that there's a use after free of the
bsg_class_device:  In bsg_kref_release_function, this is used (to do a
put_device(bcg-&gt;parent) after bcg-&gt;release has been called.  In sas (and
possibly many other things) bcd-&gt;release frees the queue which contains
the bsg_class_device, so we get a put_device on unreferenced memory.
Fix this by taking a copy of the pointer to the parent before releasing
bsg.

Acked-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
</entry>
<entry>
<title>block: Fix the starving writes bug in the anticipatory IO scheduler</title>
<updated>2008-07-01T07:06:42Z</updated>
<author>
<name>Divyesh Shah</name>
<email>dpshah@google.com</email>
</author>
<published>2008-06-16T16:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d585d0b9d73ed999cc7b8cf3cac4a5b01abb544e'/>
<id>urn:sha1:d585d0b9d73ed999cc7b8cf3cac4a5b01abb544e</id>
<content type='text'>
AS scheduler alternates between issuing read and write batches. It does
the batch switch only after all requests from the previous batch are
completed.

When switching to a write batch, if there is an on-going read request,
it waits for its completion and indicates its intention of switching by
setting ad-&gt;changed_batch and the new direction but does not update the
batch_expire_time for the new write batch which it does in the case of
no previous pending requests.
On completion of the read request, it sees that we were waiting for the
switch and schedules work for kblockd right away and resets the
ad-&gt;changed_data flag.
Now when kblockd enters dispatch_request where it is expected to pick
up a write request, it in turn ends the write batch because the
batch_expire_timer was not updated and shows the expire timestamp for
the previous batch.

This results in the write starvation for all the cases where there is
the intention for switching to a write batch, but there is a previous
in-flight read request and the batch gets reverted to a read_batch
right away.

This also holds true in the reverse case (switching from a write batch
to a read batch with an in-flight write request).

I've checked that this bug exists on 2.6.11, 2.6.18, 2.6.24 and
linux-2.6-block git HEAD. I've tested the fix on x86 platforms with
SCSI drives where the driver asks for the next request while a current
request is in-flight.

This patch is based off linux-2.6-block git HEAD.

Bug reproduction:
A simple scenario which reproduces this bug is:
- dd if=/dev/hda3 of=/dev/null &amp;
- lilo
   The lilo takes forever to complete.

This can also be reproduced fairly easily with the earlier dd and
another test
program doing msync().

The example test program below should print out a message after every
iteration
but it simply hangs forever. With this bugfix it makes forward progress.

====
Example test program using msync() (thanks to suleiman AT google DOT
com)

inline uint64_t
rdtsc(void)
{
         int64_t tsc;

         __asm __volatile("rdtsc" : "=A" (tsc));
         return (tsc);
}

int
main(int argc, char **argv)
{
         struct stat st;
         uint64_t e, s, t;
         char *p, q;
         long i;
         int fd;

         if (argc &lt; 2) {
                 printf("Usage: %s &lt;file&gt;\n", argv[0]);
                 return (1);
         }

         if ((fd = open(argv[1], O_RDWR | O_NOATIME)) &lt; 0)
                 err(1, "open");

         if (fstat(fd, &amp;st) &lt; 0)
                 err(1, "fstat");

         p = mmap(NULL, st.st_size, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);

         t = 0;
         for (i = 0; i &lt; 1000; i++) {
                 *p = 0;
                 msync(p, 4096, MS_SYNC);
                 s = rdtsc();
                *p = 0;
                 __asm __volatile(""::: "memory");
                 e = rdtsc();
                 if (argc &gt; 2)
                         printf("%d: %lld cycles %jd %jd\n",
                                i, e - s, (intmax_t)s, (intmax_t)e);
                 t += e - s;
         }
         printf("average time: %lld cycles\n", t / 1000);
         return (0);
}

Cc: &lt;stable@kernel.org&gt;
Acked-by: Nick Piggin &lt;npiggin@suse.de&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>block: disable IRQs until data is written to relay channel</title>
<updated>2008-06-12T18:20:57Z</updated>
<author>
<name>Carl Henrik Lunde</name>
<email>chlunde@ping.uio.no</email>
</author>
<published>2008-06-12T18:13:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=14a73f54798f39854e521fb596da7d50b7566bbd'/>
<id>urn:sha1:14a73f54798f39854e521fb596da7d50b7566bbd</id>
<content type='text'>
As we may run relay_reserve from interrupt context we must always disable
IRQs.  This is because a call to relay_reserve may expose previously written
data to use space.

Updated new message code and an old but related comment.

Signed-off-by: Carl Henrik Lunde &lt;chlunde@ping.uio.no&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Fix invalid access errors in blk_lookup_devt</title>
<updated>2008-06-09T17:06:24Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-06-09T17:06:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d5791d13b1d45542895104edf4b09476d5ad24b0'/>
<id>urn:sha1:d5791d13b1d45542895104edf4b09476d5ad24b0</id>
<content type='text'>
Commit 30f2f0eb4bd2c43d10a8b0d872c6e5ad8f31c9a0 ("block: do_mounts -
accept root=&lt;non-existant partition&gt;") extended blk_lookup_devt() to be
able to look up partitions that had not yet been registered, but in the
process made the assumption that the '&amp;block_class.devices' list only
contains disk devices and that you can do 'dev_to_disk(dev)' on them.

That isn't actually true.  The block_class device list also contains the
partitions we've discovered so far, and you can't just do a
'dev_to_disk()' on those.

So make sure to only work on devices that block/genhd.c has registered
itself, something we can test by checking the 'dev-&gt;type' member.  This
makes the loop in blk_lookup_devt() match the other such loops in this
file.

[ We may want to do an alternate version that knows to handle _either_
  whole-disk devices or partitions, but for now this is the minimal fix
  for a series of crashes reported by Mariusz Kozlowski in

	http://lkml.org/lkml/2008/5/25/25

  and Ingo in

	http://lkml.org/lkml/2008/6/9/39 ]

Reported-by: Mariusz Kozlowski &lt;m.kozlowski@tuxland.pl&gt;
Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Neil Brown &lt;neilb@suse.de&gt;
Cc: Joao Luis Meloni Assirati &lt;assirati@nonada.if.usp.br&gt;
Acked-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>cfq-iosched: fix RCU problem in cfq_cic_lookup()</title>
<updated>2008-05-28T12:49:28Z</updated>
<author>
<name>Jens Axboe</name>
<email>jens.axboe@oracle.com</email>
</author>
<published>2008-05-28T12:46:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d6de8be711b28049a5cb93c954722c311c7d3f7f'/>
<id>urn:sha1:d6de8be711b28049a5cb93c954722c311c7d3f7f</id>
<content type='text'>
cfq_cic_lookup() needs to properly protect ioc-&gt;ioc_data before
dereferencing it and also exclude updaters of ioc-&gt;ioc_data as well.

Also add a number of comments documenting why the existing RCU usage
is OK.

Thanks a lot to "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt; for
review and comments!

Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>block: make blktrace use per-cpu buffers for message notes</title>
<updated>2008-05-28T12:49:27Z</updated>
<author>
<name>Jens Axboe</name>
<email>jens.axboe@oracle.com</email>
</author>
<published>2008-05-28T12:45:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=64565911cdb57c2f512a9715b985b5617402cc67'/>
<id>urn:sha1:64565911cdb57c2f512a9715b985b5617402cc67</id>
<content type='text'>
Currently it uses a single static char array, but that risks
being corrupted when multiple users issue message notes at the
same time. Make the buffers dynamically allocated when the trace
is setup and make them per-cpu instead.

The default max message size of 1k is also very large, the
interface is mainly for small text notes. So shrink it to 128 bytes.

Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>Added in elevator switch message to blktrace stream</title>
<updated>2008-05-28T12:49:27Z</updated>
<author>
<name>Alan D. Brunelle</name>
<email>Alan.Brunelle@hp.com</email>
</author>
<published>2008-05-27T12:55:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4722dc52a891ab6cb2d637ddb87233e0ce277827'/>
<id>urn:sha1:4722dc52a891ab6cb2d637ddb87233e0ce277827</id>
<content type='text'>
Signed-off-by: Alan D. Brunelle &lt;alan.brunelle@hp.com&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>Added in MESSAGE notes for blktraces</title>
<updated>2008-05-28T12:49:27Z</updated>
<author>
<name>Alan D. Brunelle</name>
<email>Alan.Brunelle@hp.com</email>
</author>
<published>2008-05-27T12:54:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9d5f09a424a67ddb959829894efb4c71cbf6d600'/>
<id>urn:sha1:9d5f09a424a67ddb959829894efb4c71cbf6d600</id>
<content type='text'>
Allows messages to be inserted into blktrace streams.

Signed-off-by: Alan D. Brunelle &lt;alan.brunelle@hp.com&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>block: reorder cfq_queue to save space on 64bit builds</title>
<updated>2008-05-28T12:49:27Z</updated>
<author>
<name>Richard Kennedy</name>
<email>richard@rsk.demon.co.uk</email>
</author>
<published>2008-05-23T04:52:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=be754d2c2161c0cce11d62727016985ecb76831b'/>
<id>urn:sha1:be754d2c2161c0cce11d62727016985ecb76831b</id>
<content type='text'>
saves 8 bytes of padding &amp; increases objects/slab from 30 to 32 on my
AMD64 config

Signed-off-by: Richard Kennedy &lt;richard@rsk.demon.co.uk&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>block: Move the second call to get_request to the end of the loop</title>
<updated>2008-05-28T12:49:27Z</updated>
<author>
<name>Zhang, Yanmin</name>
<email>yanmin_zhang@linux.intel.com</email>
</author>
<published>2008-05-22T13:13:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05caf8dbc1880415df3378cfd114d832c9618b60'/>
<id>urn:sha1:05caf8dbc1880415df3378cfd114d832c9618b60</id>
<content type='text'>
In function get_request_wait, the second call to get_request could be
moved to the end of the while loop, because if the first call to
get_request fails, the second call will fail without sleep.

Signed-off-by: Zhang Yanmin &lt;yanmin.zhang@intel.com&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
</feed>
