From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 3 18:25:06 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A647A106566B; Sun, 3 Apr 2011 18:25:06 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1468FC14; Sun, 3 Apr 2011 18:25:05 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 5677245CA0; Sun, 3 Apr 2011 20:06:49 +0200 (CEST) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 45D3645C8A; Sun, 3 Apr 2011 20:06:44 +0200 (CEST) Date: Sun, 3 Apr 2011 20:06:36 +0200 From: Pawel Jakub Dawidek To: Andriy Gapon Message-ID: <20110403180636.GF1849@garage.freebsd.pl> References: <4D95E162.40605@FreeBSD.org> <4D95ECDE.1020504@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="27ZtN5FSuKKSZcBU" Content-Disposition: inline In-Reply-To: <4D95ECDE.1020504@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: FreeBSD Hackers , FreeBSD Arch Subject: Re: looking for error codes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2011 18:25:06 -0000 --27ZtN5FSuKKSZcBU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 somethi= ng I had to add as a small project here at work, and was considering cleani= ng up to try to get into CURRENT. If there's a real need for it, I could sp= eed 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). 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. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --27ZtN5FSuKKSZcBU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk2YtywACgkQForvXbEpPzSpQgCgyEDLFfXaU7g3MN7rug61d+k1 D+cAn0J9QZZxe24Qk2vi+GucC6KLIrkW =pJXb -----END PGP SIGNATURE----- --27ZtN5FSuKKSZcBU--