<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/block/blk-core.c, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-07-20T14:02:17Z</updated>
<entry>
<title>block: fix the problem of io_ticks becoming smaller</title>
<updated>2021-07-20T14:02:17Z</updated>
<author>
<name>Chunguang Xu</name>
</author>
<published>2021-07-05T21:47:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b74821a0d8d2b78ee346fc5a200da706dae84abc'/>
<id>urn:sha1:b74821a0d8d2b78ee346fc5a200da706dae84abc</id>
<content type='text'>
[ Upstream commit d80c228d44640f0b47b57a2ca4afa26ef87e16b0 ]

On the IO submission path, blk_account_io_start() may interrupt
the system interruption. When the interruption returns, the value
of part-&gt;stamp may have been updated by other cores, so the time
value collected before the interruption may be less than part-&gt;
stamp. So when this happens, we should do nothing to make io_ticks
more accurate? For kernels less than 5.0, this may cause io_ticks
to become smaller, which in turn may cause abnormal ioutil values.

Signed-off-by: Chunguang Xu &lt;brookxu@tencent.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/1625521646-1069-1-git-send-email-brookxu.cn@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>block: get rid of the trace rq insert wrapper</title>
<updated>2021-02-22T13:37:41Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-22T05:29:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b357e4a694ac4b95096715df253548f7e1f2723f'/>
<id>urn:sha1:b357e4a694ac4b95096715df253548f7e1f2723f</id>
<content type='text'>
Get rid of the wrapper for trace_block_rq_insert() and call the function
directly.

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Damien Le Moal &lt;damien.lemoal@wdc.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: skip bio_check_eod for partition-remapped bios</title>
<updated>2021-01-25T18:41:34Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-01-25T18:39:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a905c37c3510ea6d7cfcdfd0f272ba731286560'/>
<id>urn:sha1:3a905c37c3510ea6d7cfcdfd0f272ba731286560</id>
<content type='text'>
When an already remapped bio is resubmitted (e.g. by blk_queue_split),
bio_check_eod will compare the remapped bi_sector against the size
of the partition, leading to spurious I/O failures.

Skip the EOD check in this case.

Fixes: 309dca309fc3 ("block: store a block_device pointer in struct bio")
Reported-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: don't pass BIOSET_NEED_BVECS for q-&gt;bio_split</title>
<updated>2021-01-25T04:22:45Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2021-01-11T03:05:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c495a17679523c95f77f13697a71921dd5c224cd'/>
<id>urn:sha1:c495a17679523c95f77f13697a71921dd5c224cd</id>
<content type='text'>
q-&gt;bio_split is only used by bio_split() for fast cloning bio, and no
need to allocate bvecs, so remove this flag.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Reviewed-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Tested-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>blk-mq: use -&gt;bi_bdev for I/O accounting</title>
<updated>2021-01-25T01:17:20Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-01-24T10:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0b6e522cdc4a76352e5f02fc2d92198f03254425'/>
<id>urn:sha1:0b6e522cdc4a76352e5f02fc2d92198f03254425</id>
<content type='text'>
Remove the reverse map from a sector to a partition for I/O accounting by
simply using -&gt;bi_bdev.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: use -&gt;bi_bdev for bio based I/O accounting</title>
<updated>2021-01-25T01:17:20Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-01-24T10:02:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99dfc43ecbf67f12a06512918aaba61d55863efc'/>
<id>urn:sha1:99dfc43ecbf67f12a06512918aaba61d55863efc</id>
<content type='text'>
Rework the I/O accounting for bio based drivers to use -&gt;bi_bdev.  This
means all drivers can now simply use bio_start_io_acct to start
accounting, and it will take partitions into account automatically.  To
end I/O account either bio_end_io_acct can be used if the driver never
remaps I/O to a different device, or bio_end_io_acct_remapped if the
driver did remap the I/O.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: do not reassig -&gt;bi_bdev when partition remapping</title>
<updated>2021-01-25T01:17:20Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-01-24T10:02:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30c5d3456c272f0de0d7e7eb9fc355fa64a5f649'/>
<id>urn:sha1:30c5d3456c272f0de0d7e7eb9fc355fa64a5f649</id>
<content type='text'>
There is no good reason to reassign -&gt;bi_bdev when remapping the
partition-relative block number to the device wide one, as all the
information required by the drivers comes from the gendisk anyway.

Keeping the original -&gt;bi_bdev alive will allow to greatly simplify
the partition-away I/O accounting.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: simplify submit_bio_checks a bit</title>
<updated>2021-01-25T01:17:20Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-01-24T10:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2f9f6221b9b9944e96c80455b469a6f0269c558b'/>
<id>urn:sha1:2f9f6221b9b9944e96c80455b469a6f0269c558b</id>
<content type='text'>
Merge a few checks for whole devices vs partitions to streamline the
sanity checks.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: store a block_device pointer in struct bio</title>
<updated>2021-01-25T01:17:20Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-01-24T10:02:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=309dca309fc39a9e3c31b916393b74bd174fd74e'/>
<id>urn:sha1:309dca309fc39a9e3c31b916393b74bd174fd74e</id>
<content type='text'>
Replace the gendisk pointer in struct bio with a pointer to the newly
improved struct block device.  From that the gendisk can be trivially
accessed with an extra indirection, but it also allows to directly
look up all information related to partition remapping.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: add a hard-readonly flag to struct gendisk</title>
<updated>2021-01-25T01:15:57Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2021-01-09T10:42:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52f019d43c229afd65dc11c8c1b05b6436bf6765'/>
<id>urn:sha1:52f019d43c229afd65dc11c8c1b05b6436bf6765</id>
<content type='text'>
Commit 20bd1d026aac ("scsi: sd: Keep disk read-only when re-reading
partition") addressed a long-standing problem with user read-only
policy being overridden as a result of a device-initiated revalidate.
The commit has since been reverted due to a regression that left some
USB devices read-only indefinitely.

To fix the underlying problems with revalidate we need to keep track
of hardware state and user policy separately.

The gendisk has been updated to reflect the current hardware state set
by the device driver. This is done to allow returning the device to
the hardware state once the user clears the BLKROSET flag.

The resulting semantics are as follows:

 - If BLKROSET sets a given partition read-only, that partition will
   remain read-only even if the underlying storage stack initiates a
   revalidate. However, the BLKRRPART ioctl will cause the partition
   table to be dropped and any user policy on partitions will be lost.

 - If BLKROSET has not been set, both the whole disk device and any
   partitions will reflect the current write-protect state of the
   underlying device.

Based on a patch from Martin K. Petersen &lt;martin.petersen@oracle.com&gt;.

Reported-by: Oleksii Kurochko &lt;olkuroch@cisco.com&gt;
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201221
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
