From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833AbbEUHJM (ORCPT ); Thu, 21 May 2015 03:09:12 -0400 Received: from mga01.intel.com ([192.55.52.88]:44823 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754470AbbEUHJK (ORCPT ); Thu, 21 May 2015 03:09:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,466,1427785200"; d="scan'208";a="496425336" Message-ID: <555D840A.60407@intel.com> Date: Thu, 21 May 2015 10:06:50 +0300 From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Namhyung Kim , Arnaldo Carvalho de Melo CC: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: Re: [PATCH v2 3/3] perf tools: Add dso__data_get/put_fd() References: <1432137821-10853-1-git-send-email-namhyung@kernel.org> <1432137821-10853-3-git-send-email-namhyung@kernel.org> In-Reply-To: <1432137821-10853-3-git-send-email-namhyung@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/05/15 19:03, Namhyung Kim wrote: > Using dso__data_fd() in multi-thread environment is not safe since > returned fd can be closed and/or reused anytime. So convert it to the > dso__data_get/put_fd() pair to protect the access with lock. > > The original dso__data_fd() is deprecated and kept only for testing. > > Cc: Adrian Hunter > Signed-off-by: Namhyung Kim Could convert dso_cache__read() and data_file_size() over to dso__data_get/put_fd() too, but that can come later, so: Acked-by: Adrian Hunter