From: Bob Peterson Date: Tue, 5 Apr 2016 13:09:39 -0400 (EDT) Subject: [Cluster-devel] [PATCH 2/2] mkfs.gfs2: Open the target device with O_EXCL In-Reply-To: <5703CDA8.2090705@redhat.com> References: <1459865009-14109-1-git-send-email-anprice@redhat.com> <1459865009-14109-2-git-send-email-anprice@redhat.com> <2126126528.47807026.1459865667265.JavaMail.zimbra@redhat.com> <5703CDA8.2090705@redhat.com> Message-ID: <694296930.47933109.1459876179528.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- > On 05/04/16 15:14, Bob Peterson wrote: > > In fact, we used to have O_EXCL: > > > > https://git.fedorahosted.org/cgit/cluster.git/commit/gfs2/mkfs/main_mkfs.c?h=RHEL6&id=b0db0bad3e6a8996fcaecbb93bfe9f8de97b7508 > > > > I remember Ryan doing this, but I'm not sure why or how it disappeared. > > We need to chase down why O_EXCL was removed last time; whether it was just > > an oversight/mistake or whether it caused problems elsewhere. > > That check_mount() function opened the device to check whether it was > mounted and then closed it again, leaving main() to open it again > afterwards for writing. From the commit history it looks like the > function was just removed because it was racey, nothing related to the > use of O_EXCL specifically, so I don't think there's anything in the > history to suggest that it's a bad idea. > > Cheers, > Andy > Hi, In that case: ACK Regards, Bob Peterson Red Hat File Systems