Received: by 10.192.165.156 with SMTP id m28csp336418imm; Wed, 18 Apr 2018 23:18:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx48MOgEwB//jZsSSZobtPlUtKaBe0eNzMnx9XtWVojsQC0YHZLwwNsQHHzPt60BPNLy88vyQ X-Received: by 10.99.110.198 with SMTP id j189mr4010047pgc.86.1524118719988; Wed, 18 Apr 2018 23:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524118719; cv=none; d=google.com; s=arc-20160816; b=SpKgw+mPaXnxtaHEmgdD6iQYPUY9TLBTXXBurCUOg8s4IK/TkIZzJjUmIUCmStCfNO lnDdZvzCG7yxEzn6aYSPKrSsthCp21VwYPJdgASsKtXHiuAlspo44OS+i3hkm1LNUh0j pGEawy7le6ddM7I26wDBfp9v3XmtF958xnEHSnZJvvIIQENWGTansvI4gtW2fbNGFVWW pboUKHjKmOpCjYvRS8g+X0tB33bxoHJcnpDkCdLNVFQk0GrXf+1wBbKm3TT7GPScCpB7 DsmvyNO+vpOgD6RO4rOt4rwSuTy/RlyG5A3uix0ScEMYyA+fYOhILk0kOx5NMztFx/A2 9YUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ttKYiUX6i3HPOkQdG4p8WHPqGTTzEVfQCCW9D36USXM=; b=OJAhMlUI6zZu/6KcjyeoYXh0fhiT4eGjFC8tzqaksi9BFghDMwwqpBgCXoVUT4l0St vCbCgCaCVFeeb4J87Q3T+/CbTJqk8hrCeo6/fRzPqSwGro2LemUkSJxJkbifP6qKzTKf UngF0S2x5xfQL8EaLXr/DYSxnm334pKZXjqQ2BWAcfR6c8OdWRpY8MEMY7KnGpi9mFnK ZIWoVWIuV7FzCDfpcJpwf2tqixWjOlZ5xd9Tg8kegBV5ZcdnRE/uaXNGHSu/Pu17rhFk frUabWUsWiC1WUkGn4GlNwlV4LsikeVolkvPXb4VykceLclbBUkmh7MO9DEyhD04CoND XAUQ== ARC-Authentication-Results: i=1; mx.google.com; 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 q3si2475194pgs.516.2018.04.18.23.18.25; Wed, 18 Apr 2018 23:18:39 -0700 (PDT) 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; 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 S1750953AbeDSGRS (ORCPT + 99 others); Thu, 19 Apr 2018 02:17:18 -0400 Received: from mga07.intel.com ([134.134.136.100]:32248 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750708AbeDSGRR (ORCPT ); Thu, 19 Apr 2018 02:17:17 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2018 23:17:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,467,1517904000"; d="scan'208";a="33711512" Received: from um.fi.intel.com (HELO um) ([10.237.72.212]) by fmsmga008.fm.intel.com with ESMTP; 18 Apr 2018 23:17:12 -0700 Received: from ash by um with local (Exim 4.90_1) (envelope-from ) id 1f92sZ-0004aR-7l; Thu, 19 Apr 2018 09:17:11 +0300 Date: Thu, 19 Apr 2018 09:17:10 +0300 From: Alexander Shishkin To: Song Liu Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, Alexander Shishkin , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH 2/2] perf/core: fix bad use of igrab in kernel/event/core.c Message-ID: <20180419061710.l6sdq3kvricpyjdu@um.fi.intel.com> References: <20180418062907.3210386-1-songliubraving@fb.com> <20180418062907.3210386-2-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180418062907.3210386-2-songliubraving@fb.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 17, 2018 at 11:29:07PM -0700, Song Liu wrote: > As Miklos reported and suggested: > > This pattern repeats two times in trace_uprobe.c and in > kernel/events/core.c as well: > > ret = kern_path(filename, LOOKUP_FOLLOW, &path); > if (ret) > goto fail_address_parse; > > inode = igrab(d_inode(path.dentry)); > path_put(&path); > > And it's wrong. You can only hold a reference to the inode if you > have an active ref to the superblock as well (which is normally > through path.mnt) or holding s_umount. Oops. I must have snatched it from the uprobe code without thinking. > This way unmounting the containing filesystem while the tracepoint is > active will give you the "VFS: Busy inodes after unmount..." message > and a crash when the inode is finally put. > > Solution: store path instead of inode. > > This patch fixes the issue in kernel/event/core.c. > > NOTE: Based on my understanding, perf_addr_filter only supports intel_pt. Coresight too, but that's probably even further away from what you have. > However, my test system doesn't support address filtering (or I made a > mistake?). Therefore, I have NOT tested this patch. Check /sys/devices/intel_pt/caps/num_address_ranges, if it's non-zero, it's supported. > Could someone please help test it? Yes: Reviewed-and-tested-by: Alexander Shishkin The subject line needs a little love to be more like other perf commits, but other than that, looks good. Thanks!