From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 0875C70310; Thu, 4 Mar 2021 17:25:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0875C70310 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614867922; bh=Ik4haDK41ZuTmhJ8cwaVYzBDemykjsDtfxSIc92zNV8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=GXVpKyGViOzeYklr/+Cl8c8DrqCAq7sMFTWFjCpGBphrm4ht6XoZhGPQYMJfIu/vG p8FY8L+Mvie21OlPX59dtl/7jNg+F3RxAPE/Y+zjvjzfX8rqBBD7EsQwzxavSJHlDQ Mj+6Bx8Xs2KMosZETgH6EdTl0VHnA01v8MQcK7fo= Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 57FD870310 for ; Thu, 4 Mar 2021 17:25:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 57FD870310 Received: by mail-lf1-f45.google.com with SMTP id m22so43495918lfg.5 for ; Thu, 04 Mar 2021 06:25:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YSf5tvnV6cSOXLbbxsNip/4gYQG2Nh0QGdqQjAmr5dU=; b=FXZoWOtxKjlWprqOsuNqXF7FwYHMPXQB7pe+HhsQTE/ZlHckH4XjxxEWnb+wMG7dAv HD+LNIfHIchXUscOp3vICXsn2okGAX2UKT4zzvokJdnAkoftDw1gbfpduWkuCMcuaTNz dSvl7mFweDcgUKuMoBofm8+rPYNVkWIy0F+x2MHyfWIx+EVW8Wv/9drmKh2SG4Lss/63 gLOWolRg4MpCpJHzOElbkZk6rC1LvAFav+S0dZNRJ8ZlWso7SNT6uyOI7CaPEbYobyow LM+DioDEQ9QV48PKd3gYSkqHBhpBZHynIWaTfmoU17Ix9gAhSYvMGS0haYcikn9XJsgi kRxw== X-Gm-Message-State: AOAM533Ph8/B/auDqmAXvVwImRElJu9OoIBNM203dATv5KJoQHHGuWyV 7b0/ianUHn3PZGa4k94vD5Tpso0Vie4= X-Google-Smtp-Source: ABdhPJx3AAsQAKcaLHbyyEpK49kYBjuzq7mM8GtwR20/IJH6pfZk7YQtrbyjcbRf8uFMTj5OVRIEeg== X-Received: by 2002:a19:7e45:: with SMTP id z66mr2447577lfc.612.1614867918978; Thu, 04 Mar 2021 06:25:18 -0800 (PST) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id y8sm1241177ljk.9.2021.03.04.06.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 06:25:17 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id D146C5601DA; Thu, 4 Mar 2021 17:25:16 +0300 (MSK) To: tml Date: Thu, 4 Mar 2021 17:25:15 +0300 Message-Id: <20210304142515.65862-1-gorcunov@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] xlog: fix arguments processing in commit 8e429f4b7 X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Alexander Turenko Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" The order of evaluation of arguments passed to a function is not a part of language standart but compiler specifics. Thus make sure we pass proper "errno" to xdir_say_gc. Note that this is not critical issue: in case of hit we simply get wrong syserror message when file not present on a storage device. Reported-by: Aleksandr Lyapunov Signed-off-by: Cyrill Gorcunov --- Guys, I didn't create a branch for this fix since it is not critical and there is no issue for it. Even if the problem occurs it won't affect the workflow so it is rather a cosmetic fix. src/box/xlog.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/box/xlog.c b/src/box/xlog.c index 974f460be..462245d27 100644 --- a/src/box/xlog.c +++ b/src/box/xlog.c @@ -684,10 +684,13 @@ xdir_collect_garbage(struct xdir *dir, int64_t signature, unsigned flags) vclock_sum(vclock) < signature) { const char *filename = xdir_format_filename(dir, vclock_sum(vclock), NONE); - if (flags & XDIR_GC_ASYNC) + if (flags & XDIR_GC_ASYNC) { eio_unlink(filename, 0, xdir_complete_gc, NULL); - else - xdir_say_gc(unlink(filename), errno, filename); + } else { + int rc = unlink(filename); + int _errno = rc != 0 ? errno : 0; + xdir_say_gc(rc, _errno, filename); + } vclockset_remove(&dir->index, vclock); free(vclock); -- 2.29.2