Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 2014 17:27:00 +0000
From:      Steven Hartland <killing@multiplay.co.uk>
To:        Guido Falsi <mad@madpilot.net>, freebsd-fs@freebsd.org
Subject:   Re: panic: detach with active requests on 10.1-RC3
Message-ID:  <544D2EE4.6010809@multiplay.co.uk>
In-Reply-To: <544D1A3E.5000000@madpilot.net>
References:  <544A538F.6060202@FreeBSD.org> <544BBB85.2020909@madpilot.net> <544BC990.4030700@madpilot.net> <544CC4D4.7040203@FreeBSD.org> <544D137A.7010006@multiplay.co.uk> <544D1A3E.5000000@madpilot.net>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]

On 26/10/2014 15:58, Guido Falsi wrote:
>
>>> I bisected commits and finally found out this happens starting with
>>> r268815, which MFCed r268205.
>>>
>>> It is related to trim support, in fact disabling trim on the filesystm
>>> "fixes" it.
>>>
>>> I filed bug #194606 on bugzilla [1] to further track this issue, if
>>> anyone is interested.
>>>
>>> [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194606
>> Nice work Guido, can you try the attached patch and see if that fixes it
>> please?
> Sure, I'll report back ASAP

Actually looks like the fix requires more changes than I first thought, 
updated patch attached.

     Regards
     Steve

[-- Attachment #2 --]
Index: sys/cam/ata/ata_da.c
===================================================================
--- sys/cam/ata/ata_da.c	(revision 273157)
+++ sys/cam/ata/ata_da.c	(working copy)
@@ -1467,9 +1467,15 @@ ada_dsmtrim(struct ada_softc *softc, struct bio *b
 static void
 ada_cfaerase(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio)
 {
+	struct trim_request *req = &softc->trim_req;
 	uint64_t lba = bp->bio_pblkno;
 	uint16_t count = bp->bio_bcount / softc->params.secsize;
 
+	bzero(req, sizeof(*req));
+	TAILQ_INIT(&req->bps);
+	bioq_remove(&softc->trim_queue, bp);
+	TAILQ_INSERT_TAIL(&req->bps, bp, bio_queue);
+
 	cam_fill_ataio(ataio,
 	    ada_retry_count,
 	    adadone,
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?544D2EE4.6010809>