Date: Mon, 09 Dec 2013 09:27:37 +0100 From: Paolo Pinto <paolo.pinto@netasq.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: nicolas dumont <nicolas.dumont@netasq.com>, freebsd-geom@freebsd.org Subject: Re: geom_uzip, panic: bio_length in mdstart_vnode() Message-ID: <52A57EF9.5050905@netasq.com> In-Reply-To: <20131204162029.GV59496@kib.kiev.ua> References: <529F2748.2060900@netasq.com> <20131204162029.GV59496@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi Konstantin,
Thanks for the workaround, it works for me; the assertion doesn't
trigger anymore.
On 12/04/2013 05:20 PM, Konstantin Belousov wrote:
> On Wed, Dec 04, 2013 at 01:59:52PM +0100, Paolo Pinto wrote:
>> Hi list!
>>
>> My kernel is compiled with option INVARIANTS and I get a reproducible
>> kernel panic when trying to read data from a GEOM based compressed
>> memory disk:
>>
>> Unread portion of the kernel message buffer:
>> panic: bio_length 140288
>> cpuid = 3
>> KDB: stack backtrace:
>> #0 0xffffffff80909726 at kdb_backtrace+0x66
>> #1 0xffffffff808d0fa8 at panic+0x1d8
>> #2 0xffffffff80595949 at mdstart_vnode+0x619
>
> The issue is that geom_uzip creates bios which are larger than MAXPHYS.
>
> As a workaround, the following patch should be enough. It only fires
> assert when md really uses pbuf, and since geom_uzip knows nothing
> about unmapped bio, the assertion must not trigger.
>
> diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
> index 8ae51d1..639677e 100644
> --- a/sys/dev/md/md.c
> +++ b/sys/dev/md/md.c
> @@ -746,12 +746,12 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
> return (error);
> }
>
> - KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd",
> - (uintmax_t)bp->bio_length));
> if ((bp->bio_flags & BIO_UNMAPPED) == 0) {
> pb = NULL;
> aiov.iov_base = bp->bio_data;
> } else {
> + KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd",
> + (uintmax_t)bp->bio_length));
> pb = getpbuf(&md_vnode_pbuf_freecnt);
> pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n);
> aiov.iov_base = (void *)((vm_offset_t)pb->b_data +
>
--
Paolo Pinto
R&D System Engineer
NETASQ - We secure IT
[-- Attachment #2 --]
0 *H
010 + 0 *H
00
pƱHklX0
*H
010 UFR1
0UNord10UVilleneuve d'Ascq1.0,U
%NETASQ - Secure Internet Connectivity1'0%UNETASQ Certification Authority0
130813144533Z
140813144533Z010 UFR1
0UNord10UVilleneuve d'Ascq1.0,U
%NETASQ - Secure Internet Connectivity1'0%UNETASQ Certification Authority10UPaolo PINTO1%0# *H
paolo.pinto@netasq.com0"0
*H
0
`l[`<=bN hQ.dh"Rq Fm=!]4JD|`KOoeSntoّj$LW<IԍDs.NsryU2KlrhM^c/01hicUq8IB]!" ֍V%1 ;,B,#0"Ug74Au%sK% 00U7DK!LTΘ)0U#0'*D:sj %0 U0 0U0!U0paolo.pinto@netasq.com0 `HB0U%0++0
*H
)ўT$O%:`2&4*Է8Cm]7ރ
0-ho|SM_ܰaqc:`O?*Լk.s
๐FU
F5rVCƅL-zR.dPXV|hv\(0^ArY\93sp|DL3G a%AE_z!;xK
A>100010 UFR1
0UNord10UVilleneuve d'Ascq1.0,U
%NETASQ - Secure Internet Connectivity1'0%UNETASQ Certification Authority
pƱHklX0 + 50 *H
1 *H
0 *H
1
131209082737Z0# *H
1}`Ӯc\g\\|0l *H
1_0]0 `He*0 `He0
*H
0*H
0
*H
@0+0
*H
(0 +710010 UFR1
0UNord10UVilleneuve d'Ascq1.0,U
%NETASQ - Secure Internet Connectivity1'0%UNETASQ Certification Authority
pƱHklX0*H
1010 UFR1
0UNord10UVilleneuve d'Ascq1.0,U
%NETASQ - Secure Internet Connectivity1'0%UNETASQ Certification Authority
pƱHklX0
*H
H2~}Sje j|NʲZWlS"F0>Y~ڗC365ETOgeДE#l'[M1N?i`;APqL:=Em%!F53&;rC_UrL(sd^@~TKZ ݿ̹Hsp$B2CV#4q-\BpqHHr?-ዯ}`Ql <oλp9{In
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52A57EF9.5050905>
