From owner-freebsd-stable@FreeBSD.ORG Thu Jul 31 12:30:25 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB17737B401 for ; Thu, 31 Jul 2003 12:30:25 -0700 (PDT) Received: from morpheus.webteckies.org (node123e0.a2000.nl [24.132.35.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id 880CB43F75 for ; Thu, 31 Jul 2003 12:30:24 -0700 (PDT) (envelope-from freebsd-stable@webteckies.org) Received: from ghost.lan.webteckies.org (ghost.lan.webteckies.org [192.168.1.10]) by morpheus.webteckies.org (Postfix) with ESMTP id D21C9107C6 for ; Thu, 31 Jul 2003 21:29:44 +0200 (CEST) From: Melvyn Sopacua Organization: WebTeckies.org To: stable@freebsd.org Date: Thu, 31 Jul 2003 21:30:00 +0200 User-Agent: KMail/1.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307312130.00997.freebsd-stable@webteckies.org> Subject: dvd+rw-format -force problem X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2003 19:30:26 -0000 Hi, I haven't felt the need to fully blank a DVD+RW for a while untill today. In between the last time and now, I both did a cvsup of STABLE and the port of sysutils/dvd+rw-tools was upgraded. Hence - I'm not sure which could be contributed to the cause. The problem is the following: When issuing: dvd+rw-format -force /dev/cd0c it fails, with 'unable to unmount' error. A little tracing in the source, shows that the following patch, will work - but is a not-so-pretty work-around: --- transport.hxx.orig Fri Jul 11 12:57:00 2003 +++ transport.hxx Thu Jul 31 21:05:07 2003 @@ -483,8 +483,15 @@ struct statfs *mntbuf; int ret=0,mntsize,i; - if (f==-1) f=fd; - + if (f==-1) + { + f=fd; + if (f==-1) + { + f = open(filename, O_RDONLY|O_NONBLOCK); + fd = f; + } + } if (fstat (f,&fsb) < 0) return -1; if ((mntsize=getmntinfo(&mntbuf,MNT_NOWAIT))==0)return -1; The real problem here, is that the author expects, that whenever cmd.umount() is called without argument, fd is available. Looking at the associate method, it only opens fd if a struct stat is given, which the code in dvd+rw-format.cpp:main does not do. As far as I can tell, the other methods called before the call to umount, also do not open fd. Can anybody tell wether the author's expectation is wrong, or whether there's some other bug, since I'm not too farmiliar with both hardware programming as c++? -- Melvyn ======================================================= FreeBSD ghost.lan.webteckies.org 4.8-STABLE FreeBSD 4.8-STABLE #1: Tue Jul 22 23:53:48 CEST 2003 root@ghost.lan.webteckies.org:/usr/obj/usr/src/sys/GHOST i386 =======================================================