From owner-freebsd-geom@FreeBSD.ORG Thu Jun 1 23:22:46 2006 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99A4316A810 for ; Thu, 1 Jun 2006 23:22:46 +0000 (UTC) (envelope-from staylor@mrynet.com) Received: from mrynet.com (mrynet.com [63.231.249.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A75C43D53 for ; Thu, 1 Jun 2006 23:22:45 +0000 (GMT) (envelope-from staylor@mrynet.com) Received: from mrynet.com (smmsp@localhost [127.0.0.1]) by mrynet.com (8.13.6/8.13.6) with ESMTP id k51NMVRI072283 for ; Thu, 1 Jun 2006 18:22:31 -0500 (CDT) (envelope-from staylor@mrynet.com) Received: (from root@localhost) by mrynet.com (8.13.6/8.13.6/Submit) id k51NMVKh072282 for freebsd-geom@freebsd.org; Thu, 1 Jun 2006 18:22:31 -0500 (CDT) (envelope-from staylor) Message-Id: <200606012322.k51NMVKh072282@mrynet.com> From: staylor@mrynet.com (User Staylor) Date: Thu, 1 Jun 2006 18:22:31 -0500 X-Mailer: Mail User's Shell (7.2.6 beta(5) jp(8) 11/23/00) To: freebsd-geom@freebsd.org Subject: GEOM and changing floppy sector sizes X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2006 23:22:57 -0000 I have a situation with FreeBSD 7-current and the geom structure used for the fdc floppy controller. To access floppy media that has sectors with differing sector sizes, I issue an FD_STYPE ioctl call to change the sector size. This appears to work fine when incresing the sector size (say from 128 to 256). However, if the already-opened file-descriptor attempts to change the sector size down to 128 when 256-byte sectors have already been read on the FD, an "Invalid argument" (EINVAL) is returned. Is this indicating a limitation in the GEOM kernel code, or is it a bug? I have confirmed that the read() request never makes it to the fdc driver code in the kernel, so the GEOM or other code is returning the error. And I can successfully perform reads to the opened device descriptor using the last-used (in this case 256) sector size by doubling read byte-count request (to 256), and then I can only perform seeks to every other sector's byte position. Any suggestions on how to further isolate the limitation, or any more info I can provide? I thought perhaps the GEOM mechanism used by fdc(4) was limiting sector changes on established media as I want to accomplish. Thanks in advance, -scott