From patchwork Fri Jun 3 04:26:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 9151691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E287E6072B for ; Fri, 3 Jun 2016 04:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D62ED2780C for ; Fri, 3 Jun 2016 04:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C99AE28309; Fri, 3 Jun 2016 04:27:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D6662780C for ; Fri, 3 Jun 2016 04:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750993AbcFCE0w (ORCPT ); Fri, 3 Jun 2016 00:26:52 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:49296 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbcFCE0w (ORCPT ); Fri, 3 Jun 2016 00:26:52 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.86_2 #1 (Red Hat Linux)) id 1b8gh6-00041K-H1; Fri, 03 Jun 2016 04:26:48 +0000 Date: Fri, 3 Jun 2016 05:26:48 +0100 From: Al Viro To: Oleg Drokin Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org, " Mailing List" , "" Subject: Re: NFS/d_splice_alias breakage Message-ID: <20160603042648.GN14480@ZenIV.linux.org.uk> References: <20160603033750.GL14480@ZenIV.linux.org.uk> <0C971585-6BFC-4665-832B-9B262F733BFC@linuxhacker.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0C971585-6BFC-4665-832B-9B262F733BFC@linuxhacker.ru> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jun 02, 2016 at 11:43:59PM -0400, Oleg Drokin wrote: > > Which of the call sites had that been and how does one reproduce that fun? > > If you feel that posting a reproducer in the open is a bad idea, just send > > it off-list... > > This is fs/nfs/dir.c::nfs_lookup() right after no_entry label. Bloody hell... Was that sucker hashed on the entry into nfs_lookup()? If we get that with call as a method, we are really fucked. Ho-hum... One of the goto no_open; in nfs_atomic_open()? That would mean a stale negative dentry in dcache that has escaped revalidation... Wait a minute, didn't nfs ->d_revalidate() skip everything in some cases, leaving it to ->atomic_open()? Looks like the right thing to do would be to do d_drop() at no_open:, just before we call nfs_lookup(). If not earlier, actually... How about the following? --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index aaf7bd0..6e3a6f4 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1536,9 +1536,9 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry, err = PTR_ERR(inode); trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); put_nfs_open_context(ctx); + d_drop(dentry); switch (err) { case -ENOENT: - d_drop(dentry); d_add(dentry, NULL); nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); break;