From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbbFHOxN (ORCPT ); Mon, 8 Jun 2015 10:53:13 -0400 Received: from mail.kernel.org ([198.145.29.136]:54197 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbbFHOxI (ORCPT ); Mon, 8 Jun 2015 10:53:08 -0400 Date: Mon, 8 Jun 2015 11:53:03 -0300 From: Arnaldo Carvalho de Melo To: Milos Vyletel Cc: Peter Zijlstra , Ingo Molnar , Jiri Olsa , Namhyung Kim , Andy Shevchenko , Don Zickus , "Steven Rostedt (Red Hat)" , "open list:PERFORMANCE EVENT..." Subject: Re: [PATCH v2] perf tools: avoid possible race condition in copyfile Message-ID: <20150608145303.GE3136@kernel.org> References: <1433775018-19868-1-git-send-email-milos@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433775018-19868-1-git-send-email-milos@redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Jun 08, 2015 at 04:50:16PM +0200, Milos Vyletel escreveu: > Use unique temporary files when copying to buildid dir to prevent races > in case multiple instances are trying to copy same file. This is done by > > - creating template in form /..XXXXXX where the suffix is > used by mkstemp() to create unique file > - change file mode > - copy content > - if successful link temp file to target file > - unlink temp file Thanks, applied, will be in my next pull request to Ingo, - Arnaldo