Received: by 10.192.165.148 with SMTP id m20csp514230imm; Fri, 20 Apr 2018 10:22:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx48j4GWe71mgGmoBs44JL/7VXX6ng5M07LBtLUEWUHPjeZnIcKS+sc02JoKWYDeFOoEQAt8b X-Received: by 2002:a17:902:bd03:: with SMTP id p3-v6mr11029932pls.236.1524244931575; Fri, 20 Apr 2018 10:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524244931; cv=none; d=google.com; s=arc-20160816; b=FcXxfkRvyL4S5jLPOwAplE/PiGDZi14ctR823OUFkOXNu9XQN2QyGalOSr6p9bGKOz ZQ1wvuEZ6nGCGfodKX4bsd9pD2fyIkINdUG0JS5uSxAXqSYOYlv4JZXJXx1jYTGwI9+O czlKUrdbidSjWmcII8o4xjhWAFO77ANLM62Eu8ioLpBZHtDTZhQIgm7mljKmfd3Y5O6y 3G7Ynffwui5o4EfvohUVRiDfrjq2lkkopSOOYhVGYlzxIOk6uYe6kaIhBcu8kNmRf1Pp BS2PmtLlDSHP+DEb4A/zokcxMpjAC3R5RfhHp60hjcIAFgAxudJ13sNXuxT/OC1e3P1K DZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:smtp-origin-cluster:cc:to :smtp-origin-hostname:from:smtp-origin-hostprefix:dkim-signature :arc-authentication-results; bh=6IEKy1vX+xnrLSoThbBxvEYqA2+ccxI3Zbc5zYWrZAo=; b=sPzBpK5mZJuDJRf8/QIVNnzSzwzV/uYk1MWvXqWgvH/ASyfg/ouwLNTdS0Iq4zMAFx nk6tQnCk/GhHqFeKvnN2hGTpEqW6DuRgTU7Rsl6yXZbjfSywBkbQcG72dvt2QyJ4gAoC pIlrHzHDoiH7AvadqEyB58Gt1J6UnGdHvnBz6o+d9OTNYoAeAnaMSBkUiukpLxg5Mrat 6YhWmp1rpToF+SWxKROj29g5OpDie3XLjLUo99g/3rdcedv4zGqJNjffUteRr4jA2agU kCQzPx3m/ITbgrqpzhiIUMe5GgxJw0o5Eui5Bjy/dJYxqAicmYCwxvLX3LiZ5BOAcxsA hvjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=YpZWqwK/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8-v6si6322444plk.550.2018.04.20.10.21.56; Fri, 20 Apr 2018 10:22:11 -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; dkim=pass header.i=@fb.com header.s=facebook header.b=YpZWqwK/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752806AbeDTRUk (ORCPT + 99 others); Fri, 20 Apr 2018 13:20:40 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:37412 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbeDTRUj (ORCPT ); Fri, 20 Apr 2018 13:20:39 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3KHKS6Y017325 for ; Fri, 20 Apr 2018 10:20:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=6IEKy1vX+xnrLSoThbBxvEYqA2+ccxI3Zbc5zYWrZAo=; b=YpZWqwK/6e+FXWaeL3XAU+taQvdAgmwpfzhxB4N9QEjdrqWxdw4Owtv4XzJkwqv+lmv3 CHkZ5z9zKgT1lUSAe8JqgTXqGBMP0dOD5rWg43R1QPyVnKyzVbQ706e/GHyiqoc3URTD 0XhNLBjQ7pt7IsBOvsytcPNrDsMTufFXPjw= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2hfhgfgg4f-4 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 20 Apr 2018 10:20:38 -0700 Received: from mx-out.facebook.com (192.168.52.123) by PRN-CHUB05.TheFacebook.com (192.168.16.15) with Microsoft SMTP Server id 14.3.361.1; Fri, 20 Apr 2018 10:18:55 -0700 Received: by devbig102.frc2.facebook.com (Postfix, from userid 4523) id 6C95842821DC; Fri, 20 Apr 2018 09:56:27 -0700 (PDT) Smtp-Origin-Hostprefix: devbig From: Song Liu Smtp-Origin-Hostname: devbig102.frc2.facebook.com To: CC: , Song Liu , Steven Rostedt , Ingo Molnar , Howard McLauchlan , Josef Bacik , Srikar Dronamraju , Miklos Szeredi Smtp-Origin-Cluster: frc2c02 Subject: [PATCH v3 2/2] tracing: remove igrab() iput() call from uprobes.c Date: Fri, 20 Apr 2018 09:56:25 -0700 Message-ID: <20180420165625.129593-2-songliubraving@fb.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180420165625.129593-1-songliubraving@fb.com> References: <20180420165625.129593-1-songliubraving@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-20_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Caller of uprobe_register is required to keep the inode and containing mount point referenced. Cc: Steven Rostedt Cc: Ingo Molnar Cc: Howard McLauchlan Cc: Josef Bacik Cc: Srikar Dronamraju Cc: Miklos Szeredi Signed-off-by: Song Liu --- kernel/events/uprobes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index ce6848e..20486bb 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -491,7 +491,6 @@ static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset) if (!uprobe) return NULL; - uprobe->inode = igrab(inode); uprobe->offset = offset; init_rwsem(&uprobe->register_rwsem); init_rwsem(&uprobe->consumer_rwsem); @@ -502,7 +501,6 @@ static struct uprobe *alloc_uprobe(struct inode *inode, loff_t offset) if (cur_uprobe) { kfree(uprobe); uprobe = cur_uprobe; - iput(inode); } return uprobe; @@ -701,7 +699,6 @@ static void delete_uprobe(struct uprobe *uprobe) rb_erase(&uprobe->rb_node, &uprobes_tree); spin_unlock(&uprobes_treelock); RB_CLEAR_NODE(&uprobe->rb_node); /* for uprobe_is_active() */ - iput(uprobe->inode); put_uprobe(uprobe); } @@ -873,7 +870,8 @@ static void __uprobe_unregister(struct uprobe *uprobe, struct uprobe_consumer *u * tuple). Creation refcount stops uprobe_unregister from freeing the * @uprobe even before the register operation is complete. Creation * refcount is released when the last @uc for the @uprobe - * unregisters. + * unregisters. Caller of uprobe_register() is required to keep @inode + * (and the containing mount) referenced. * * Return errno if it cannot successully install probes * else return 0 (success) -- 2.9.5