From owner-freebsd-scsi@FreeBSD.ORG Sun Feb 3 17:12:36 2013 Return-Path: Delivered-To: freebsd-scsi@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 89FEC696 for ; Sun, 3 Feb 2013 17:12:36 +0000 (UTC) (envelope-from jau@oxit.fi) Received: from smtp.oxit.fi (smtp.oxit.fi [193.185.41.132]) by mx1.freebsd.org (Postfix) with ESMTP id 01BBD15B for ; Sun, 3 Feb 2013 17:12:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.oxit.fi (Postfix) with ESMTP id 5502E6C226F; Sun, 3 Feb 2013 19:04:03 +0200 (EET) X-Virus-Scanned: Debian amavisd-new at smtp.oxit.fi Received: from smtp.oxit.fi ([127.0.0.1]) by localhost (huskvarna.oxit.fi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pd+FxkbSdu6T; Sun, 3 Feb 2013 19:03:57 +0200 (EET) Received: from [192.168.1.131] (ip193-64-26-115.cust.eunet.fi [193.64.26.115]) by smtp.oxit.fi (Postfix) with ESMTPSA id D0E4F6C053F; Sun, 3 Feb 2013 19:03:56 +0200 (EET) Message-ID: <510E987C.4090509@oxit.fi> Date: Sun, 03 Feb 2013 19:03:56 +0200 From: "Jukka A. Ukkonen" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: freebsd-scsi@FreeBSD.org Subject: Re: Multiple FreeBSD SCSI Hosts Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Joerg Wunsch X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 17:12:36 -0000 Hello all, I have been browsing through these old messages about the SCSI RESERVE/RELEASE operations in FreeBSD. What nobody seems to have quite realized at the time is that a multiply attached SCSI device can be used as the trusted 3rd party for a "cluster group" or for anything which should be active only at one node at any particular time. E.g. Solaris cluster groups do exactly that. If one node gets the reservation through, no other node will until the first successful one either releases the device or crashes. The reserved LUN can be either an otherwise unused small storage unit or one that is going to be anyhow mounted and unmounted as the cluster group dictates. The same method would work also for selecting the leader among Shared QFS metadata servers and for other similar purposes. The reservation should definitely not be only bundled inside the mount operations. Instead it should be possible to trigger reserve and release through ioctl() or through a separate system call. This is because sometimes the feature might be used for unmounted raw devices or for devices which could be logically mounted to multiple systems while anyhow busy for all other systems but one. E.g. something in the style of Shared QFS could use a SCSI reservation to its metadata volumes, which need not visible to the users as separate file systems at all. Anyhow I could see seriously more use for this particular SCSI feature than just locking a mounted tape drive were it implemented for other devices than sa only and somehow exported to the user space. Obviously it should be available for root only, though. Cheers, --jau