Re: [PATCH 2/4] perf tools: Fix dso__data_read_offset() file opening

From: Adrian Hunter
Date: Wed May 20 2015 - 11:36:56 EST


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()

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/