Date: Sun, 3 Apr 2011 21:30:10 -0600 From: Warner Losh <imp@bsdimp.com> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: FreeBSD Hackers <freebsd-hackers@FreeBSD.org>, Andriy Gapon <avg@FreeBSD.org>, FreeBSD Arch <freebsd-arch@FreeBSD.org> Subject: Re: looking for error codes Message-ID: <15B9A193-6298-459C-A2E3-E049C1E186FB@bsdimp.com> In-Reply-To: <20110403180636.GF1849@garage.freebsd.pl> References: <4D95E162.40605@FreeBSD.org> <F98114A0-0C00-46EF-BD0C-E48F97FFF3E1@bsdimp.com> <AC6674AB7BC78549BB231821ABF7A9AEB52F1950BB@EMBX01-WF.jnpr.net> <4D95ECDE.1020504@FreeBSD.org> <20110403180636.GF1849@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 3, 2011, at 12:06 PM, Pawel Jakub Dawidek wrote: > On Fri, Apr 01, 2011 at 06:18:54PM +0300, Andriy Gapon wrote: >> on 01/04/2011 18:04 Andrew Duane said the following: >>> AFAIK, FreeBSD does not really detect read-only media. This was = something I had to add as a small project here at work, and was = considering cleaning up to try to get into CURRENT. If there's a real = need for it, I could speed that up. >>>=20 >>=20 >> Yes, that's exactly the problem that I am looking at. >> So if you have anything to share it will be greatly appreciated at = least by me. >> But I think many more people could benefit from it (e.g. those having = SD/SDHC/etc >> cards). >=20 > Once you detect read-only media, I suggest to implement the support by > adding new DISKFLAG_READONLY to disk(9) API and simply deny write = access > in g_disk_access() when DISKFLAG_READONLY is set. And if I pop out the SD card and flip the switch, what then? Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15B9A193-6298-459C-A2E3-E049C1E186FB>