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 avoid. /Andrew -----Original Message----- From: Andriy Gapon [mailto:a...@freebsd.org] Sent: Friday, April 08, 2011 11:23 AM To: Andrew Duane Cc: Bruce Evans; freebsd...@freebsd.org; FreeBSD Hackers; freebsd-s...@freebsd.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 hardware 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 only after a failed write attempt. But there are many things that I don't know about... -- Andriy Gapon _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"