Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752641AbaAOSfI (ORCPT ); Wed, 15 Jan 2014 13:35:08 -0500 Received: from mail-qa0-f49.google.com ([209.85.216.49]:48990 "EHLO mail-qa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbaAOSfG (ORCPT ); Wed, 15 Jan 2014 13:35:06 -0500 MIME-Version: 1.0 X-Originating-IP: [86.59.245.170] In-Reply-To: <20140115181955.GA5715@fieldses.org> References: <1389219015-10980-1-git-send-email-miklos@szeredi.hu> <1389219015-10980-6-git-send-email-miklos@szeredi.hu> <20140115181955.GA5715@fieldses.org> Date: Wed, 15 Jan 2014 19:35:04 +0100 Message-ID: Subject: Re: [PATCH 05/11] vfs: add RENAME_NOREPLACE flag From: Miklos Szeredi To: "J. Bruce Fields" Cc: Al Viro , Linus Torvalds , Linux-Fsdevel , Kernel Mailing List , Christoph Hellwig , Andrew Morton , David Howells , Zach Brown , Jan Kara , Andy Lutomirski , "mszeredi@suse.cz" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 15, 2014 at 7:19 PM, J. Bruce Fields wrote: > On Wed, Jan 08, 2014 at 11:10:09PM +0100, Miklos Szeredi wrote: >> From: Miklos Szeredi >> >> If this flag is specified and the target of the rename exists then the >> rename syscall fails with EEXIST. > > Why is this useful? > > (I'm sure it is, it'd just be useful to have the reasons recorded > someplace.) > >> The VFS does the existence checking, so it is trivial to enable for most >> local filesystems. This patch only enables it in ext4. >> >> For network filesystems the VFS check is not enough as there may be a race >> between a remote create and the rename, so these filesystems need to handle >> this flag in their ->rename() implementations to ensure atomicity. > > Till that's done this should probably result in -EOPNOTSUPP on those > filesystems? > > I think this would need new protocol in the NFS case. Yes, it needs to be enabled on a case-by-case basis. Only enabled for ext4 now, but trivial to do for most fs. Thanks, Miklos -- 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/