From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH v2] vfs: Don't exchange "short" filenames unconditionally. Date: Fri, 26 Sep 2014 21:23:22 +0100 Message-ID: <20140926202322.GA11829@ZenIV.linux.org.uk> References: <1411582473-29184-1-git-send-email-sem@altlinux.org> <20140924185521.GC7996@ZenIV.linux.org.uk> <20140924201813.GI7996@ZenIV.linux.org.uk> <20140925044601.GL7996@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Mikhail Efremov , Linux Kernel Mailing List , Miklos Szeredi , linux-fsdevel , stable , Sage Weil To: Linus Torvalds Return-path: Content-Disposition: inline In-Reply-To: <20140925044601.GL7996@ZenIV.linux.org.uk> Sender: stable-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Sep 25, 2014 at 05:46:01AM +0100, Al Viro wrote: > I really wonder if it's possible to get d_rehash() hitting the victim of > (non-exchange) __d_move(). _Then_ this patch (as well as the historical > behaviour it restores, all way back to 2.5, if not 2.3) would, indeed, > be buggy. More fun: what's going on in ceph_handle_notrace_create()? AFAICS, this struct dentry *result = ceph_lookup(dir, dentry, 0); if (result && !IS_ERR(result)) { /* * We created the item, then did a lookup, and found * it was already linked to another inode we already * had in our cache (and thus got spliced). Link our * dentry to that inode, but don't hash it, just in * case the VFS wants to dereference it. */ BUG_ON(!result->d_inode); d_instantiate(dentry, result->d_inode); return 0; } is bogus. What will happen if server goes nuts and that existing alias picked by lookup turns out to be a directory? And while we are at it, what's to prevent a leak if we ever hit that codepath, directory or no directory? Sage?