<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/block/blk-lib.c, branch dev</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>http://git.gnuabordo.com.br/linux.git/atom?h=dev</id>
<link rel='self' href='http://git.gnuabordo.com.br/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/'/>
<updated>2024-07-05T06:53:15+00:00</updated>
<entry>
<title>blk-lib: check for kill signal in ioctl BLKZEROOUT</title>
<updated>2024-07-05T06:53:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-07-01T16:51:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=bf86bcdb40123ee99669ee91b67e023669433a1a'/>
<id>urn:sha1:bf86bcdb40123ee99669ee91b67e023669433a1a</id>
<content type='text'>
Zeroout can access a significant capacity and take longer than the user
expected.  A user may change their mind about wanting to run that
command and attempt to kill the process and do something else with their
device. But since the task is uninterruptable, they have to wait for it
to finish, which could be many hours.

Add a new BLKDEV_ZERO_KILLABLE flag for blkdev_issue_zeroout that checks
for a fatal signal at each iteration so the user doesn't have to wait for
their regretted operation to complete naturally.

Heavily based on an earlier patch from Keith Busch.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/r/20240701165219.1571322-11-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: limit the Write Zeroes to manually writing zeroes fallback</title>
<updated>2024-07-05T06:53:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-07-01T16:51:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=39722a2f2bcd82bdecc226711412d88b54fcb05b'/>
<id>urn:sha1:39722a2f2bcd82bdecc226711412d88b54fcb05b</id>
<content type='text'>
Only fall back from hardware Write Zeroes failures when
blkdev_issue_write_zeroes returns -EOPNOTSUPP;

Note that blkdev_issue_write_zeroes turns any failure into -EOPNOTSUPP
when the write zeroes queue limit has been cleared to 0, so this still
catches all I/O errors where the driver detected missing support
for the hardware acceleration.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/r/20240701165219.1571322-10-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: refacto blkdev_issue_zeroout</title>
<updated>2024-07-05T06:53:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-07-01T16:51:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=99800ced26b9d87a918aa9824881bdb90a3c1b03'/>
<id>urn:sha1:99800ced26b9d87a918aa9824881bdb90a3c1b03</id>
<content type='text'>
Split out two well-defined helpers for hardware supported Write Zeroes
and manually writing zeroes using the Write command.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/r/20240701165219.1571322-9-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: move read-only and supported checks into (__)blkdev_issue_zeroout</title>
<updated>2024-07-05T06:53:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-07-01T16:51:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=f6eacb26541ad1eabc40d7e9f5cd86bae7dc0b46'/>
<id>urn:sha1:f6eacb26541ad1eabc40d7e9f5cd86bae7dc0b46</id>
<content type='text'>
Move these checks out of the lower level helpers and into the higher level
ones to prepare for refactoring.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/r/20240701165219.1571322-8-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: remove the LBA alignment check in __blkdev_issue_zeroout</title>
<updated>2024-07-05T06:53:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-07-01T16:51:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=ff760a8f0d09f4ba7574ae2ca8be987854f5246d'/>
<id>urn:sha1:ff760a8f0d09f4ba7574ae2ca8be987854f5246d</id>
<content type='text'>
__blkdev_issue_zeroout is a purely kernel internal API and thus can rely
on the block layer sector alignment checks.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/r/20240701165219.1571322-7-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: factor out a blk_write_zeroes_limit helper</title>
<updated>2024-07-05T06:53:15+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-07-01T16:51:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=73a768d5f95533574bb8ace34eb683a88c40509e'/>
<id>urn:sha1:73a768d5f95533574bb8ace34eb683a88c40509e</id>
<content type='text'>
Contrary to the comment in __blkdev_issue_write_zeroes, nothing here
checks for a potential bi_size overflow.  Add a helper mirroring
the secure erase code for the check.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Link: https://lore.kernel.org/r/20240701165219.1571322-6-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: add a blk_alloc_discard_bio helper</title>
<updated>2024-05-07T13:29:42+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-05-06T04:20:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=e8b4869bc78da1a71f2a2ab476caf50c1dcfeed0'/>
<id>urn:sha1:e8b4869bc78da1a71f2a2ab476caf50c1dcfeed0</id>
<content type='text'>
Factor out a helper from __blkdev_issue_discard that chews off as much as
possible from a discard range and allocates a bio for it.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/20240506042027.2289826-5-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: move discard checks into the ioctl handler</title>
<updated>2024-05-07T13:29:42+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-05-06T04:20:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=30f1e724142242a453f92d90b33e030014900bf0'/>
<id>urn:sha1:30f1e724142242a453f92d90b33e030014900bf0</id>
<content type='text'>
Most bio operations get basic sanity checking in submit_bio and anything
more complicated than that is done in the callers.  Discards are a bit
different from that in that a lot of checking is done in
__blkdev_issue_discard, and the specific errnos for that are returned
to userspace.  Move the checks that require specific errnos to the ioctl
handler instead, and just leave the basic sanity checking in submit_bio
for the other handlers.  This introduces two changes in behavior:

 1) the logical block size alignment check of the start and len is lost
    for non-ioctl callers.
    This matches what is done for other operations including reads and
    writes.  We should probably verify this for all bios, but for now
    make discards match the normal flow.
 2) for non-ioctl callers all errors are reported on I/O completion now
    instead of synchronously.  Callers in general mostly ignore or log
    errors so this will actually simplify the code once cleaned up

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/20240506042027.2289826-3-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: remove the discard_granularity check in __blkdev_issue_discard</title>
<updated>2024-05-07T13:29:42+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-05-06T04:20:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=0942592045782e76a9d52c409955c2dc313cbd30'/>
<id>urn:sha1:0942592045782e76a9d52c409955c2dc313cbd30</id>
<content type='text'>
We now set a default granularity in the queue limits API, so don't
bother with this extra check.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/20240506042027.2289826-2-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>Revert "blk-lib: check for kill signal"</title>
<updated>2024-03-14T02:35:48+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2024-03-14T02:16:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.gnuabordo.com.br/linux.git/commit/?id=bf5e3a30f777b6e763f6a46c10e1250c20237e97'/>
<id>urn:sha1:bf5e3a30f777b6e763f6a46c10e1250c20237e97</id>
<content type='text'>
This reverts commit 8a08c5fd89b447a7de7eb293a7a274c46b932ba2.

It turns out while this is a perfectly valid and long overdue thing to do
for user initiated discards / zeroing from the ioctl handler, it actually
breaks file system use of the discard helper by interrupting in places
the file system doesn't expect, and by leaving the bio chain in a state
that the file system callers of (at least) __blkdev_issue_discard do
not expect.

Revert the change for now, we'll redo it for the next merge window
after refactoring the code to better split the file system vs ioctl
callers and cleaning up a few other loose ends.

Reported-by: Chandan Babu R &lt;chandanbabu@kernel.org&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Keith Busch &lt;kbusch@kernel.org&gt;
Link: https://lore.kernel.org/r/20240314021623.1908895-1-hch@lst.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
