Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Sep 2022 14:09:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 266158] bio_length and bio_bcount in the GEOM bio structure are documented to be the same, but they are not
Message-ID:  <bug-266158-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266158

            Bug ID: 266158
           Summary: bio_length and bio_bcount in the GEOM bio structure
                    are documented to be the same, but they are not
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: 0mp@FreeBSD.org

In the source code (sys/sys/bio.h), bio_bcount is documented as "Valid byte=
s in
buffer". bio_length is documented as "Like bio_bcount". Unfortunately, they=
 are
not the same. Here's a sh(1) script to show that:

    # Create a memory device.
    md=3D$(mdconfig -s 1G)
    # Trace the io subsystem when the dd command is executing. Limit the
results to
    # the PID of the dd command only.
    dtrace -n '
            io:::start /pid =3D=3D $target/ {
                    @bcount[execname] =3D quantize(args[0]->bio_bcount);
                    @length[execname] =3D quantize(args[0]->bio_length);
            }
    ' -c "dd if=3D/dev/random of=3D/dev/$md bs=3D1m count=3D230 oflag=3Dsyn=
c"
    # Remove the memory device.
    mdconfig -d -u "$md"

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-266158-227>