From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f54.google.com ([74.125.83.54]:36722 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756250AbcKWD5S (ORCPT ); Tue, 22 Nov 2016 22:57:18 -0500 Received: by mail-pg0-f54.google.com with SMTP id f188so819039pgc.3 for ; Tue, 22 Nov 2016 19:57:18 -0800 (PST) Date: Tue, 22 Nov 2016 19:57:16 -0800 From: Omar Sandoval To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, kernel-team@fb.com, Linus Torvalds Subject: Re: [RFC PATCH 2/3] vfs: add d_replace() Message-ID: <20161123035716.GA29697@mew> References: <527297d2dae27845b3b7ba8ad6e81ef477fddee2.1479802448.git.osandov@fb.com> <20161123034004.GK1555@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161123034004.GK1555@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Nov 23, 2016 at 03:40:04AM +0000, Al Viro wrote: > On Tue, Nov 22, 2016 at 12:25:02AM -0800, Omar Sandoval wrote: > > From: Omar Sandoval > > > > Changes the inode associated with a dentry. This'll be useful for > > implementations of linkat() AT_REPLACE. > > Hard NAK. That violates all kinds of assumptions made by VFS and > filesystems alike; never, ever do that. If you have a reference to > a positive dentry, inode should *NEVER* change. Okay, thanks for the sanity check. > If it unhashed the old dentry, created a new one and attached inode to > it, it _might_ have a chance. I'm less than sure it's a good idea, but > it this form it's a non-starter. One thing I considered was having the filesystem unhash the dentry and just letting the next lookup that comes along instantiate the new one. Is that better or worse than doing something like your suggestion? > Again, > > NAKed-by: Al Viro > > and don't bring it back in that form. -- Omar