On Wed, May 07, 2025 at 03:33:23PM +0800, Zhang Yi wrote:
> On 2025/5/6 20:11, Christoph Hellwig wrote:
> > On Tue, May 06, 2025 at 07:16:56PM +0800, Zhang Yi wrote:
> >> Sorry, but I don't understand your suggestion. The
> >> STATX_ATTR_WRITE_ZEROES_UNMAP attribute only indicate whether the bdev
>
On Wed, May 07, 2025 at 03:33:23PM +0800, Zhang Yi wrote:
> On 2025/5/6 20:11, Christoph Hellwig wrote:
> > On Tue, May 06, 2025 at 07:16:56PM +0800, Zhang Yi wrote:
> >> Sorry, but I don't understand your suggestion. The
> >> STATX_ATTR_WRITE_ZEROES_UNMAP attribute only indicate whether the bdev
>
Found by Fedora's static analysis [1].
[1]
https://openscanhub.fedoraproject.org/task/51915/log/device-mapper-multipath-0.11.1-1.fc43/scan-results.html#def41
Signed-off-by: Martin Wilck
Reviewed-by: Benjamin Marzinski
---
kpartx/kpartx_id | 8
1 file changed, 4 insertions(+), 4 delet
We always add or remove a single element in vector_add_slot() and
vector_remove_slot(). Use of the VECTOR_DEFAULT_SIZE macro suggests that
its value can be changed, but this is not the case.
Remove the macro.
Signed-off-by: Martin Wilck
---
libmpathutil/vector.c | 4 ++--
libmpathutil/vector.h
We use v->allocated with the semantics of "length" or "number of used
elements" of a vector. If realloc() fails while deleting an element,
we should keep the previously allocated v->slot array but still
decrement "allocated" in order to avoid accessing invalid vector
elements.
The next successful
Found by Fedora's static analysis [1].
[1]
https://openscanhub.fedoraproject.org/task/51915/log/device-mapper-multipath-0.11.1-1.fc43/scan-results.html#def44
Signed-off-by: Martin Wilck
Reviewed-by: Benjamin Marzinski
---
libmpathpersist/mpath_persist_int.c | 12 ++--
1 file changed,
Found by Fedora's static analysis [1].
[1]
https://openscanhub.fedoraproject.org/task/51915/log/device-mapper-multipath-0.11.1-1.fc43/scan-results.html#def68
Signed-off-by: Martin Wilck
Reviewed-by: Benjamin Marzinski
---
libmultipath/prioritizers/iet.c | 3 +++
1 file changed, 3 insertions(+
Xose has kindly informed me about the warnings from Fedora's static
code analysis tool.
I'm sending a couple of related fixes here.
In the cover letter of v1 of this series [1], I'd included a discussion
of what I considered false positives, but many of those might actually
be real, as subsequent
This function is unused, and its implementation looks odd.
Remove it.
Signed-off-by: Martin Wilck
---
libmpathutil/vector.c | 13 -
libmpathutil/vector.h | 1 -
2 files changed, 14 deletions(-)
diff --git a/libmpathutil/vector.c b/libmpathutil/vector.c
index f69d644..6ad5dd5 100644
Error: CPPCHECK_WARNING (CWE-758): [#def61]
multipath-tools-0.11.1/libmultipath/nvme-ioctl.c:572:
error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits
is undefined behaviour
Found by Fedora's static analysis [1].
[1]
https://openscanhub.fedoraproject.org/task/51915/log/device-m
Found by Fedora's static analysis [1].
[1]
https://openscanhub.fedoraproject.org/task/51915/log/device-mapper-multipath-0.11.1-1.fc43/scan-results.html#def43
Signed-off-by: Martin Wilck
Reviewed-by: Benjamin Marzinski
---
kpartx/kpartx.c | 14 +++---
1 file changed, 7 insertions(+), 7
Replace the code building a bio from a kernel direct map address and
submitting it synchronously with the bdev_rw_virt helper.
Signed-off-by: Christoph Hellwig
Acked-by: David Sterba
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
Reviewed-by: Qu Wenruo
---
fs/btrfs/scrub.c | 10
Add a helper to add a vmalloc region to a bio, abstracting away the
vmalloc addresses from the underlying pages and another one wrapping
it for the simple case where all data fits into a single bio.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
---
On 5/7/25 3:40 AM, Malte Schröder wrote:
kernel 6.15-rc5 fails to access lvs which use mirroring (lvcreate -m1).
Last working release is -rc4. Reverting
5a2a6c428190f945c5cbf5791f72dbea83e97f66 fixes the issue.
From commit f1aff4bc199cb92c055668caed65505e3b4d2656 in Linus' master
branch:
Fixes
On Mon, May 05, 2025 at 06:29:52PM +0200, Martin Wilck wrote:
> Xose has kindly informed me about the warnings from Fedora's static
> code analysis tool.
>
> I'm sending a couple of related fixes here. Most of the warnings
> appear to be false positives though, see below (a second look by
> anothe
On 5/7/25 6:04 AM, Christoph Hellwig wrote:
> +/**
> + * bdev_rw_virt - synchronously read into / write from kernel mapping
> + * @bdev:block device to access
> + * @sector: sector to access
> + * @data:data to read/write
> + * @len: length in byte to read/write
> + * @op:
On Wed, 07 May 2025 14:04:24 +0200, Christoph Hellwig wrote:
> this series adds more block layer helpers to remove boilerplate code when
> adding memory to a bio or to even do the entire synchronous I/O.
>
> The main aim is to avoid having to convert to a struct page in the caller
> when adding
Replace the code building a bio from a kernel direct map address and
submitting it synchronously with the bdev_rw_virt helper.
Signed-off-by: Christoph Hellwig
Acked-by: Yangtao Li
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
---
fs/hfsplus/wrapper.c | 46 +-
That way the bio can be allocated with the right operation already
set and there is no need to pass the separated 'reading' argument.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Johannes Thumshirn
---
block/blk-map.c | 30
Remove the q argument from blk_rq_map_kern and the internal helpers
called by it as the queue can trivially be derived from the request.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Johannes Thumshirn
---
block/blk-map.c| 2
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the
bio_add_virt_nofail helper implementing it and use bio_add_vmalloc
to insulate xfs from the details of adding vmalloc memory to a bio.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
fs/xfs/xfs_buf.c | 43 +
Switch zonefs_read_super to allocate the superblock buffer using kmalloc
which falls back to the page allocator for PAGE_SIZE allocation but
gives us a kernel virtual address and then use bdev_rw_virt to perform
the synchronous read into it.
Signed-off-by: Christoph Hellwig
Acked-by: Damien Le Mo
Use the bio_add_virt_nofail and bio_add_vmalloc helpers to abstract
away the details of the memory allocation.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: "Darrick J. Wong"
---
fs/xfs/xfs_log.c | 32 ++--
1 file changed, 6 insertions(+)
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the
bio_add_virt_nofail helper implementing it, and do the same for the
similar pattern using bio_add_page for adding the first segment after
a bio allocation as that can't fail either.
Signed-off-by: Christoph Hellwig
Acked-by: Miku
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the
bio_add_virt_nofail helper implementing it.
Signed-off-by: Christoph Hellwig
Acked-by: Mikulas Patocka
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
---
drivers/md/dm-bufio.c | 2 +-
1 file changed, 1 insertion(
Delegate to bdev_rw_virt when operating on non-vmalloc memory and use
bio_add_vmalloc_chunk to insulate xfs from the details of adding vmalloc
memory to a bio.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Darrick J. Wong
---
fs/xfs/xfs_bio_io.c | 30 ---
Switch gfs2_read_super to allocate the superblock buffer using kmalloc
which falls back to the page allocator for PAGE_SIZE allocation but
gives us a kernel virtual address and then use bdev_rw_virt to perform
the synchronous read into it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Andreas Gru
Split hib_submit_io into a sync and async version. The sync version is
a small wrapper around bdev_rw_virt which implements all the logic to
add a kernel direct mapping range to a bio and synchronously submits it,
while the async version is slightly simplified using the
bio_add_virt_nofail for add
Use the bio_add_virt_nofail to add a single kernel virtual address
to a bio as that can't fail.
Signed-off-by: Christoph Hellwig
Acked-by: Jack Wang
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
---
drivers/block/rnbd/rnbd-srv.c | 7 +--
1 file changed, 1 insertion(+), 6 del
Rewrite bio_map_kern using the new bio_add_* helpers and drop the
kerneldoc comment that is superfluous for an internal helper.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
---
block/blk-map.c | 56
Convert the __bio_add_page(..., virt_to_page(), ...) pattern to the
bio_add_virt_nofail helper implementing it.
Signed-off-by: Christoph Hellwig
Acked-by: Coly Li
Reviewed-by: Damien Le Moal
Reviewed-by: Johannes Thumshirn
---
drivers/md/bcache/super.c | 3 +--
1 file changed, 1 insertion(+),
Add a helper to perform synchronous I/O on a kernel direct map range.
Currently this is implemented in various places in usually not very
efficient ways, so provide a generic helper instead.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: J
Add a helper to check how many bio_vecs are needed to add a kernel
virtual address range to a bio, accounting for the always contiguous
direct mapping and vmalloc mappings that usually need a bio_vec
per page sized chunk.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by:
Add a helper to add a directly mapped kernel virtual address to a
bio so that callers don't have to convert to pages or folios.
For now only the _nofail variant is provided as that is what all the
obvious callers want.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Ha
Hi all,
this series adds more block layer helpers to remove boilerplate code when
adding memory to a bio or to even do the entire synchronous I/O.
The main aim is to avoid having to convert to a struct page in the caller
when adding kernel direct mapping or vmalloc memory.
Changes since v2:
- r
Hi,
kernel 6.15-rc5 fails to access lvs which use mirroring (lvcreate -m1).
Last working release is -rc4. Reverting
5a2a6c428190f945c5cbf5791f72dbea83e97f66 fixes the issue.
Output of "lvs" when broken:
/dev/mapper/vg_nvme-wine_games: open failed: No such file or directory
Expected raid segm
On 2025/5/6 23:55, Darrick J. Wong wrote:
> On Tue, May 06, 2025 at 02:10:12PM +0200, Christoph Hellwig wrote:
>> On Tue, May 06, 2025 at 07:25:06PM +0800, Zhang Yi wrote:
>>> + if (request_mask & STATX_WRITE_ZEROES_UNMAP &&
>>> + bdev_write_zeroes_unmap(bdev))
>>> + s
On 2025/5/6 20:11, Christoph Hellwig wrote:
> On Tue, May 06, 2025 at 07:16:56PM +0800, Zhang Yi wrote:
>> Sorry, but I don't understand your suggestion. The
>> STATX_ATTR_WRITE_ZEROES_UNMAP attribute only indicate whether the bdev
>> and the block device that under the specified file support unmap
On Tue, 2025-05-06 at 18:01 -0400, Benjamin Marzinski wrote:
> On Mon, May 05, 2025 at 06:29:56PM +0200, Martin Wilck wrote:
> > Try to silence a gcc warning. Also, replace the wrong-looking
> > VECTOR_DEFAULT_SIZE by 1 (after all, we've just deleted a single
> > element).
> >
> > Found by Fedora'
On Tue, 2025-05-06 at 18:26 -0400, Benjamin Marzinski wrote:
> On Mon, May 05, 2025 at 06:29:52PM +0200, Martin Wilck wrote:
> > Xose has kindly informed me about the warnings from Fedora's static
> > code analysis tool.
> >
> > I'm sending a couple of related fixes here. Most of the warnings
> >
40 matches
Mail list logo