From patchwork Thu Oct 8 17:28:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leandro Awa X-Patchwork-Id: 7354361 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 28CF6BEEA4 for ; Thu, 8 Oct 2015 17:28:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F83420819 for ; Thu, 8 Oct 2015 17:28:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30EF320816 for ; Thu, 8 Oct 2015 17:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965176AbbJHR2o (ORCPT ); Thu, 8 Oct 2015 13:28:44 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:8889 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965137AbbJHR2l (ORCPT ); Thu, 8 Oct 2015 13:28:41 -0400 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com id ; Thu, 08 Oct 2015 10:28:44 -0700 Received: from HQMAIL103.nvidia.com ([172.20.187.11]) by hqnvupgp08.nvidia.com (PGP Universal service); Thu, 08 Oct 2015 10:27:38 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 08 Oct 2015 10:27:38 -0700 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL103.nvidia.com (172.20.187.11) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 8 Oct 2015 17:28:40 +0000 Received: from HQMAIL102.nvidia.com ([fe80::41e5:f424:ee31:bd6d]) by HQMAIL102.nvidia.com ([fe80::41e5:f424:ee31:bd6d%19]) with mapi id 15.00.1044.021; Thu, 8 Oct 2015 17:28:40 +0000 From: Leandro Awa To: Trond Myklebust , Alexander Viro CC: Linux NFS Mailing List , "Linux FS-devel Mailing List" Subject: RE: RCU caching regression in kernel v4.1+ Thread-Topic: RCU caching regression in kernel v4.1+ Thread-Index: AQHRATH/5c2hSAKLQ0iKrAWN7hIaJZ5hjpkAgABL4zA= Date: Thu, 8 Oct 2015 17:28:40 +0000 Message-ID: <891c441822444259aeea17e9a72edcb9@HQMAIL102.nvidia.com> References: <1444308880.43040.1.camel@primarydata.com> In-Reply-To: <1444308880.43040.1.camel@primarydata.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.17.128.97] MIME-Version: 1.0 Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Trond, Sure. I'm running the test now. It should be done within the next 4 hours. Best Regards, Leandro Awa -----Original Message----- From: Trond Myklebust [mailto:trond.myklebust@primarydata.com] Sent: Thursday, October 08, 2015 5:55 AM To: Alexander Viro Cc: Linux NFS Mailing List; Leandro Awa; Linux FS-devel Mailing List Subject: Re: RCU caching regression in kernel v4.1+ On Wed, 2015-10-07 at 14:57 -0400, Trond Myklebust wrote: > Hi Al, > > Please could you take a look at the bugzilla entry in > https://bugzilla.kernel.org/show_bug.cgi?id=104911 ? > > It describes a NFS caching regression that appears to be caused by > commit 766c4cbfacd8634d7580bac6a1b8456e63de3e84 ("namei: > d_is_negative() should be checked before ->d_seq validation"). > > Shouldn't that test for 'if (negative) return -ENOENT;' happen after > the call to d_revalidate() in lookup_fast()? If not, we can end up > caching negative dentries forever, AFAICS... > > Cheers > Trond Leandro, can you please test if the following patch helps in any way? Cheers Trond 8<----------------------------------------------------------------- From eb61ece5739bb2f3b6d03dd8ca8e335bf0d12687 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Thu, 8 Oct 2015 08:44:00 -0400 Subject: [PATCH] namei: results of d_is_negative() should be checked after dentry revalidation Leandro Awa writes: After switching to version 4.1.6, our parallelized and distributed workflows now fail consistently with errors of the form: T34: ./regex.c:39:22: error: config.h: No such file or directory From our 'git bisect' testing, the following commit appears to be the possible cause of the behavior we've been seeing: commit 766c4cbfacd8 The issue is that revalidation may cause the dentry to be dropped in NFS if, say, the client notes that the directory timestamps have changed. Reported-by: Leandro Awa Link: https://bugzilla.kernel.org/show_bug.cgi?id=104911 Fixes: 766c4cbfacd8 ("namei: d_is_negative() should be checked...") Cc: stable@vger.kernel.org # v4.1+ Signed-off-by: Trond Myklebust --- fs/namei.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) goto unlazy; } } + /* + * Note: do negative dentry check after revalidation in + * case that drops it. + */ + if (negative) + return -ENOENT; path->mnt = mnt; path->dentry = dentry; if (likely(__follow_mount_rcu(nd, path, inode, seqp))) -- 2.4.3 -- Trond Myklebust Linux NFS client maintainer, PrimaryData trond.myklebust@primarydata.com ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- diff --git a/fs/namei.c b/fs/namei.c index 726d211db484..33e9495a3129 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1558,8 +1558,6 @@ static int lookup_fast(struct nameidata *nd, negative = d_is_negative(dentry); if (read_seqcount_retry(&dentry->d_seq, seq)) return -ECHILD; - if (negative) - return -ENOENT; /* * This sequence count validates that the parent had no @@ -1580,6 +1578,12 @@ static int lookup_fast(struct nameidata *nd,