From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932226AbbETPgF (ORCPT ); Wed, 20 May 2015 11:36:05 -0400 Received: from mga02.intel.com ([134.134.136.20]:46550 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753303AbbETPgA (ORCPT ); Wed, 20 May 2015 11:36:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,465,1427785200"; d="scan'208";a="729076801" Message-ID: <555CA9D2.7000805@intel.com> Date: Wed, 20 May 2015 18:35:46 +0300 From: Adrian Hunter User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Namhyung Kim CC: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: Re: [PATCH 2/4] perf tools: Fix dso__data_read_offset() file opening References: <1432103647-14017-1-git-send-email-namhyung@kernel.org> <1432103647-14017-2-git-send-email-namhyung@kernel.org> <555C41DA.9090303@intel.com> <20150520151144.GE29162@danjae.kornet> In-Reply-To: <20150520151144.GE29162@danjae.kornet> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/05/2015 6:11 p.m., Namhyung Kim wrote: > On Wed, May 20, 2015 at 11:12:10AM +0300, Adrian Hunter wrote: >> On 20/05/15 09:34, Namhyung Kim wrote: >>> { >>> enum dso_binary_type binary_type_data[] = { >>> DSO_BINARY_TYPE__BUILD_ID_CACHE, >>> @@ -457,14 +449,6 @@ int dso__data_fd(struct dso *dso, struct machine *machine) >>> }; >>> int i = 0; >>> >>> - if (dso->data.status == DSO_DATA_STATUS_ERROR) >>> - return -1; >> >> Please retain this check. It is needed to prevent repeatedly >> trying to open files that aren't there. > > I just move it out of the function, so it'll be checked before > entering this function without lock. data_file_size() isn't doing that though. It just calls try_to_open_dso()