From owner-freebsd-scsi@FreeBSD.ORG Sun Jan 14 09:53:40 2007 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 337D916A412; Sun, 14 Jan 2007 09:53:40 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id DBC6E13C45D; Sun, 14 Jan 2007 09:53:39 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1H623V-0008yq-Dl; Sun, 14 Jan 2007 11:53:37 +0200 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: Scott Long In-reply-to: <45A91A02.906@samsco.org> References: <20070112195549.GA77181@freebie.xs4all.nl> <45A7F6A4.4030707@samsco.org> <45A91A02.906@samsco.org> Comments: In-reply-to Scott Long message dated "Sat, 13 Jan 2007 10:42:26 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 14 Jan 2007 11:53:37 +0200 From: Danny Braniss Message-ID: Cc: Wilko Bulte , Pawel Jakub Dawidek , freebsd-hackers@freebsd.org, freebsd-scsi@freebsd.org Subject: Re: iSCSI disconnects dilema X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2007 09:53:40 -0000 ... > > So you had a scenario where a program was doing I/O right up to system > (initiator) shutdown, and some of those I/O's got lost in the process? > I guess I don't understand why the OS didn't flush all outstanding I/O > buffers after terminating the program and before finishing the shutdown. > Maybe you are doing something illegal in your driver, or maybe you need > to implement a kernel shutdown hook that will allow you to block the > shutdown until everything is flushed. > the problem was solved! it just took me a while to find the cause :-) the driver picks the fd/socket from userland, via fgetsock(...), this increases the socket usage count, which I wrongly believed would save me from the userland exiting. a call to fget(...) now solves this, and so shutdown can now flush all iscsi buffers, and fsck'in is not necesary on reboot. danny > Scott