From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754637AbaAUNbn (ORCPT ); Tue, 21 Jan 2014 08:31:43 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:45797 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750935AbaAUNbk (ORCPT ); Tue, 21 Jan 2014 08:31:40 -0500 MIME-Version: 1.0 In-Reply-To: References: <1389953232-9428-1-git-send-email-piastry@etersoft.ru> Date: Tue, 21 Jan 2014 17:31:39 +0400 X-Google-Sender-Auth: 1L469h3OMhmuJyU8sfdV7qVdAYE Message-ID: Subject: Re: [PATCH v7 0/7] Add O_DENY* support for VFS and CIFS/NFS From: Pavel Shilovsky To: "Volker.Lendecke@SerNet.DE" Cc: Kernel Mailing List , linux-cifs , linux-fsdevel , Linux NFS Mailing list , wine-devel@winehq.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2014/1/20 Volker Lendecke : >> You can try to use O_PATH flag. It doesn't give you a delete access >> but should be ok because further deleting will be done without file >> descriptor -- through unlink syscall. > > Ok, I did not know about O_PATH. Thanks for that! > > So I do an open with O_PATH. How do I then make sure that > nobody else has a O_DENYDELETE set without doing the unlink > itself? It's not possible with the current API to do it through open syscall. Another possibility is to look at /proc/locks. But I think we really need O_DELETE flag that will force a file to be removed on close - we will be able to do O_DENYDELETE checks atomically. -- Best regards, Pavel Shilovsky.