Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750754AbWBEW2J (ORCPT ); Sun, 5 Feb 2006 17:28:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750760AbWBEW2J (ORCPT ); Sun, 5 Feb 2006 17:28:09 -0500 Received: from cantor.suse.de ([195.135.220.2]:32919 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1750754AbWBEW2I (ORCPT ); Sun, 5 Feb 2006 17:28:08 -0500 From: Neil Brown To: Kyle Moffett Date: Mon, 6 Feb 2006 09:27:57 +1100 Message-ID: <17382.31725.813127.10435@cse.unsw.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Phillip Susi , Jan Engelhardt , Krzysztof Halasa , Olivier Galibert , linux-kernel@vger.kernel.org Subject: Re: CD writing in future Linux (stirring up a hornets' nest) In-Reply-To: message from Kyle Moffett on Sunday February 5 References: <43E1EA35.nail4R02QCGIW@burner> <20060202161853.GB8833@voodoo> <787b0d920602020917u1e7267c5lbea5f02182e0c952@mail.gmail.com> <20060202210949.GD10352@voodoo> <43E27792.nail54V1B1B3Z@burner> <"787b0d920602 <43E62492.6080506@cfl.rr.com> X-Mailer: VM 7.19 under Emacs 21.4.1 X-face: v[Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9D > If you specify O_EXCL (and not O_CREAT), it is implementation defined > what will happen (in the Linux case, this opens a block device for > exclusive access). With Linux, O_EXCL on a block devices isn't *exactly* exclusive access. It only provided you exclusive access against other people who ask for exclusive access, which includes in-kernel usage like mount, md, dm, and swap. So if you open a block device O_EXCL, it will fail if the block device is already open O_EXCL or is mounted, or in use by the kernel in some other way (including if a partition is open O_EXCL). An if you succeed in getting an O_EXCL open, then no-one else will be able to get an O_EXCL open, or mount the filesystem etc. Bit on open without O_EXCL will always succeed no matter whether someone has it O_EXCL or not. So it is a lot like an advisory exclusive lock on the whole block device. NeilBrown - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/