From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 45B3646970E for ; Mon, 13 Jan 2020 18:44:48 +0300 (MSK) Date: Mon, 13 Jan 2020 18:44:50 +0300 From: Alexander Turenko Message-ID: <20200113154450.u2zvncitbmbflvuu@tkn_work_nb> References: <20200113121449.36540-1-huston.mavr@gmail.com> <20200113122854.GH31304@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200113122854.GH31304@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2] fio: fix race condition in mktree List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexandr Barulev Cc: tarantool-patches@dev.tarantool.org Added the comment to the code: diff --git a/src/lua/fio.lua b/src/lua/fio.lua index c9aeac951..4692e1026 100644 --- a/src/lua/fio.lua +++ b/src/lua/fio.lua @@ -364,6 +364,10 @@ fio.mktree = function(path, mode) local stat = fio.stat(current_dir) if stat == nil then local st, err = fio.mkdir(current_dir, mode) + -- fio.stat() and fio.mkdir() above are separate calls + -- and a file system may be changed between them. So + -- if the error here is due to an existing directory, + -- the function should not report an error. if err ~= nil and not fio.path.is_dir(current_dir) then return false, string.format("Error creating directory %s: %s", current_dir, tostring(err)) Pushed to master, 2.3, 2.2 and 1.10. > > Related to https://github.com/tarantool/doc/issues/1063 > > Side note: you can mention the ticket from other repo queue the > following way: > | Relates to tarantool/doc#1063 Don't sure I would prefer this way: a link is simpler for me. I left it as an https link.