Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp184475imu; Tue, 27 Nov 2018 10:46:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/XgNORPIfhcpXbUxEdMbmT49xHrHX1+KVlPF2tYUfcH+79q0FgBqZCDFfZmsVw3zsZVIu3j X-Received: by 2002:a17:902:4281:: with SMTP id h1-v6mr33571611pld.114.1543344404091; Tue, 27 Nov 2018 10:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543344404; cv=none; d=google.com; s=arc-20160816; b=ZTyRawQOjnKl6p5IyNSeDoTxInvJsYeE/RhQ7m1LC1I9iyZo5dAu7puDT1qdJFj5Om ZnpomsKwzqWnad+WJ2BuUKuPlc50qu4FbXi3/ctw+pngmMUS3Kfv176kyruzrV/OwXBh ialXwdXmCpaZydLA8TARHi6EXVNqZA59WLrxciotVIxJstJDpjN3PJrjA5YKXqDC87HY h98SSKteRkZ4VPQfC+V3hs/xDzItIrpe9HboWeR3SWo4NXzlqoExlyrUMk9WM1Gup+mq l5hLq6/26s9wEIOBTX/No4QtICk5nOWoA85JwzhnZpmhUCrPCI9gzcQP/7IMsImmDiEN T8uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kda4nFVztvjkiVWb+e1BVcnkxL0O06XMDSjXUZDWbEE=; b=FsfM91YEHjWKbGB4fLwVp0LaDJdyXkQD7glf+jxOUl0bRqCFJIiaDwohTa1lju7zYv JEeAXYoh2K+8k2eBGZZupEPVyIhRfdXos2lNlOVaRF3BFBq8y8Wv4ikfdnptji/sS30k LPfrgowhaQ9rF+Sc50El6PWPK4KSKcZMekRaaaLvTD0UaYRs8gjAdNWKm07XXdb51jzU uOWUgaL2AKTpfe8oz2DgNRs+W2jT5yEdSLb9KZQrFXB7tX3pQwliueS/KOtnaN4tPgDi 6b/sJ23mKWci1sGWH7OHMyZ6DYhmLpkrrdbMZdG+gtIAoWIVAoKsWk7QFFFCL5+sHCBr hx8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=gTsZpqqw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si4637729plo.111.2018.11.27.10.46.28; Tue, 27 Nov 2018 10:46:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=gTsZpqqw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730760AbeK0VbN (ORCPT + 99 others); Tue, 27 Nov 2018 16:31:13 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:45906 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729093AbeK0VbN (ORCPT ); Tue, 27 Nov 2018 16:31:13 -0500 Received: by mail-io1-f67.google.com with SMTP id w7so16537405iom.12 for ; Tue, 27 Nov 2018 02:33:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kda4nFVztvjkiVWb+e1BVcnkxL0O06XMDSjXUZDWbEE=; b=gTsZpqqwW9zsMtm1lmJ16dfDMWHDIKtQwCe1lzBDtvmUNRBK5PelmQMq0bh8PzrLS0 Z+cdacigD3CbMfUri3roeMlSWB1il/krICagK1hALmczaWPh3QmUC2RSHYmVOiD66mXY ihAX7vYpyGvQr4xFWEavZqxGuQmog54v3F/To= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kda4nFVztvjkiVWb+e1BVcnkxL0O06XMDSjXUZDWbEE=; b=XCBVZRQTQjO/SkbVyI5U2BWgf0I9Gd0BcSgYA+5neCjxKonCtLPO/D+KEvdpFxdxUa SObxGvoAjn0TtaoynpcNwoyfpl67aHse02N8ox+4Av0ekJn5qXE+mBA5Nw7/eiwQ4l2x tWU8jGEKOXviEyPlmKjGk41H1o4iC0o6ZLabqxUwIjhGbk2iZy/8zt0CEBiuuEcP7j4G 1lAzbeMgcaJSvKQWLqQM1dRT21C3Y8E6W6qWezu2X7DSiI2UA1xxI/tqrj9I8YET240l u8Qi7DJaCPiMMh5i12HnqVmqKypiVxZnSd2lSvLId1DWtcSFvCEaWchzJgPnx2OBNHAY VVCA== X-Gm-Message-State: AA+aEWaTky5ZxImJ9ziDwxGpBPnQBkWU1fmMSPWChUp18iD8YeCkzYup +D1BzLw5K7hFhAXXTBvcWqY8jiZHopR4hY2sjk5Mwg== X-Received: by 2002:a5d:9698:: with SMTP id m24mr289153ion.246.1543314825653; Tue, 27 Nov 2018 02:33:45 -0800 (PST) MIME-Version: 1.0 References: <1543104923-81192-1-git-send-email-bianpan2016@163.com> <20181127092551.GC16301@quack2.suse.cz> <20181127095712.GA32100@bp> <20181127100536.GF16301@quack2.suse.cz> In-Reply-To: <20181127100536.GF16301@quack2.suse.cz> From: Miklos Szeredi Date: Tue, 27 Nov 2018 11:33:33 +0100 Message-ID: Subject: Re: [PATCH V2] namei: free new_dentry late To: Jan Kara Cc: bianpan2016@163.com, Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 11:05 AM Jan Kara wrote: > > On Tue 27-11-18 17:57:12, PanBian wrote: > > I am not quite sure about the actual execution logic. But I guess new_dentry > > reference may be dropped outside vfs_rename in cocurrent executions. > > Otherwise, there is no need to acquire & drop new_dentry reference as it > > is always alive along vfs_rename. > > I don't think that's the case. The dget() - dput() pair just looks > superfluous to me in vfs_rename(). Am I missing something Miklos? I think those are to protect against d_delete() called from fs to reset d_inode. The caller indeed has to hold one ref anyway. So not superfluous, but only needed due to d_delete() and not to protect against freeing of dentry. Thanks, Miklos