Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Mar 2016 15:58:34 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-current@FreeBSD.org
Subject:   [Bug 208275] Kernel panic when reading from /dev/cd0 with a damaged dvd
Message-ID:  <bug-208275-3554-1qiCGn6TGt@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-208275-3554@https.bugs.freebsd.org/bugzilla/>
References:  <bug-208275-3554@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=3D208275

--- Comment #9 from Fabian Keil <fk@fabiankeil.de> ---
I agree that moving the n calculation behind the error block
is technically sufficient to prevent the panic.

I added the NULL check in front of the brelse() because the function
contains a comment that indicates that passing NULL to it is considered
incorrect.

My assumption was that the brelse() was there for a reason and that bp
would sometimes not be NULL or at least could be in the future.

cluster_read() and bread*() indeed seem to reliably reset bp to NULL
on error, but unlike breadn_flags(), cluster_read() has no comment that
explicitly mentions this, so I wasn't sure that one can depend on this
behaviour.

If the behaviour is unlikely to change in the future, I agree that the
brelse() should be removed.

--=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-208275-3554-1qiCGn6TGt>