From owner-freebsd-fs@FreeBSD.ORG Fri Apr 8 16:47:20 2011 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F3E7106568A; Fri, 8 Apr 2011 16:47:20 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og112.obsmtp.com (exprod7og112.obsmtp.com [64.18.2.177]) by mx1.freebsd.org (Postfix) with ESMTP id C8D278FC16; Fri, 8 Apr 2011 16:47:13 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob112.postini.com ([64.18.6.12]) with SMTP ID DSNKTZ88EFo/4nuoeLgyiOrLkJ9ea9lbxtpc@postini.com; Fri, 08 Apr 2011 09:47:19 PDT Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB03-HQ.jnpr.net (172.24.192.37) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 8 Apr 2011 09:43:39 -0700 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Fri, 8 Apr 2011 12:45:24 -0400 From: Andrew Duane To: Andriy Gapon Date: Fri, 8 Apr 2011 12:45:23 -0400 Thread-Topic: retry mounting with ro when rw fails Thread-Index: Acv2AO1qThMsSukkTE2FDMO0vOVbogAC01og Message-ID: References: <4D9DF375.4080506@FreeBSD.org> <20110408000025.GA16252@icarus.home.lan> <4D9EF55C.5070300@FreeBSD.org> <20110408214920.I1265@besplex.bde.org> <4D9F286B.4010102@FreeBSD.org> In-Reply-To: <4D9F286B.4010102@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-fs@freebsd.org" , FreeBSD Hackers , "freebsd-scsi@FreeBSD.org" Subject: RE: retry mounting with ro when rw fails X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2011 16:47:20 -0000 For SCSI-attached disks, yes. But other hardware has write-protect sensing = (SD cards, CD-roms, our platform). So if you can do that, you should Cleaning up after a failed write is a real problem, one that I needed to av= oid.=20 /Andrew =20 -----Original Message----- From: Andriy Gapon [mailto:avg@FreeBSD.org]=20 Sent: Friday, April 08, 2011 11:23 AM To: Andrew Duane Cc: Bruce Evans; freebsd-fs@freebsd.org; FreeBSD Hackers; freebsd-scsi@Free= BSD.org Subject: Re: retry mounting with ro when rw fails on 08/04/2011 15:36 Andrew Duane said the following: > What I was hoping to do was design a better mechanism for passing that R/= O > detection from the device to the filesystem code. Our implementation uses= a > platform sysctl that checks the incoming device name against some hardwar= e or > software settings. Ick. I don't know enough about device/GEOM calls to do= it > better though. I am actually not aware of any way to inquiry write-protection status from hardware. There are distinct SCSI sense codes for that, but you get them o= nly after a failed write attempt. But there are many things that I don't know about... --=20 Andriy Gapon