Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Mar 2016 11:30:36 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-amd64@FreeBSD.org
Subject:   [Bug 208365] [umass] Cannot fsck 3TB USB disk
Message-ID:  <bug-208365-6-EJUSF97AWc@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-208365-6@https.bugs.freebsd.org/bugzilla/>
References:  <bug-208365-6@https.bugs.freebsd.org/bugzilla/>

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

--- Comment #10 from Hans Petter Selasky <hselasky@FreeBSD.org> ---
I'm able to reproduce the problem using the following kernel patch and
test-program on the latest and greatest 11-current:

diff --git a/sys/x86/x86/busdma_machdep.c b/sys/x86/x86/busdma_machdep.c
index c96b26d..a4c0af7 100644
--- a/sys/x86/x86/busdma_machdep.c
+++ b/sys/x86/x86/busdma_machdep.c
@@ -97,6 +97,13 @@ bus_dma_run_filter(struct bus_dma_tag_common *tc, bus_ad=
dr_t
paddr)
 {
        int retval;

+       if (tc->flags & BUS_DMA_KEEP_PG_OFFSET) {
+               if ((paddr % 3) =3D=3D 0) {
+                       printf("F");
+                       return (1);
+               }
+       }
+
        retval =3D 0;
        do {
                if (((paddr > tc->lowaddr && paddr <=3D tc->highaddr) ||

cat << EOF > test.c
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
        int fd =3D open("/dev/da0", O_RDONLY);
        char buffer[65536];
        int y;

        if (fd < 0)
                return (0);

        y =3D 65536;
        while (1) {
                (void) malloc(512);
                if (lseek(fd, 0, 0) < 0)
                        printf("ERROR seek\n");
                if (read(fd, buffer, y) !=3D y)
                        printf("ERROR read\n");
        }
        close(fd);

        return (0);
}
EOF


Memory stick is connected through USB 3.0 port XHCI.

It appears that when bounce pages are mixed with non-bounce pages the probl=
em
happens.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



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