From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uPM+C3Nx2l7xMAAA0tVLHw (envelope-from ) for ; Fri, 05 Jun 2020 16:23:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CK4aB3Nx2l6ZWwAA1q6Kng (envelope-from ) for ; Fri, 05 Jun 2020 16:23:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 542DD940363 for ; Fri, 5 Jun 2020 16:23:14 +0000 (UTC) Received: from localhost ([::1]:37396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhF7f-00076o-2O for larch@yhetil.org; Fri, 05 Jun 2020 12:23:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhF7X-00076g-Rl for bug-guix@gnu.org; Fri, 05 Jun 2020 12:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhF7X-0003hH-I8 for bug-guix@gnu.org; Fri, 05 Jun 2020 12:23:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhF7W-0001jf-Ea for bug-guix@gnu.org; Fri, 05 Jun 2020 12:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41607: Deleted store items are not actually deleted Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 05 Jun 2020 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41607 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Christopher Marusich Received: via spool by 41607-submit@debbugs.gnu.org id=B41607.15913741276581 (code B ref 41607); Fri, 05 Jun 2020 16:23:02 +0000 Received: (at 41607) by debbugs.gnu.org; 5 Jun 2020 16:22:07 +0000 Received: from localhost ([127.0.0.1]:49700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhF6c-0001i4-Sq for submit@debbugs.gnu.org; Fri, 05 Jun 2020 12:22:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhF6a-0001hb-VF for 41607@debbugs.gnu.org; Fri, 05 Jun 2020 12:22:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40689) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhF6V-0003Ie-Ky; Fri, 05 Jun 2020 12:21:59 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=50282 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jhF6V-0007fy-7w; Fri, 05 Jun 2020 12:21:59 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20200528181043.GC23745@jasmine.lan> <20200529170820.GA30828@jasmine.lan> <20200529180245.GA3754@jasmine.lan> <20200529190942.GA8440@jasmine.lan> <87r1v0k8hl.fsf@gmail.com> <87eeqvcaau.fsf@gnu.org> <87r1uu1x9e.fsf@gmail.com> <87pnad6eor.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 Prairial an 228 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 05 Jun 2020 18:21:56 +0200 In-Reply-To: <87pnad6eor.fsf@gmail.com> (Christopher Marusich's message of "Fri, 05 Jun 2020 02:32:20 -0700") Message-ID: <877dwl32l7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 41607@debbugs.gnu.org, Stephen Scheck Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: 6jgL2Ls64DWz Howdy! Christopher Marusich skribis: > Here is a patch. Turns out it's was just a one line change! If nobody > has any further feedback on it, I'll go ahead and merge it to the master > branch in the next couple days. Yay! > From 505481a6a22819a42320f693988c3f8e13ded080 Mon Sep 17 00:00:00 2001 > From: Chris Marusich > Date: Thu, 4 Jun 2020 23:26:19 -0700 > Subject: [PATCH] daemon: Handle EXDEV when moving to trash directory. > > Fixes . > Reported by Stephen Scheck . > > * nix/libstore/gc.cc (LocalStore::deletePathRecursive): When we try to > move a dead directory into the trashDir using rename(2) but it returns > an EXDEV error, just delete the directory instead. This can happen in a > Docker container when the directory is not on the "top layer". > --- > nix/libstore/gc.cc | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc > index 8bc4e01eb0..845fe278c7 100644 > --- a/nix/libstore/gc.cc > +++ b/nix/libstore/gc.cc > @@ -455,7 +455,10 @@ void LocalStore::deletePathRecursive(GCState & state= , const Path & path) > throw SysError(format("unable to rename `%1%' to `%2%'")= % path % tmp); > state.bytesInvalidated +=3D size; > } catch (SysError & e) { > - if (e.errNo =3D=3D ENOSPC) { > + // In a Docker container, rename(2) returns EXDEV when the s= ource > + // and destination are not both on the "top layer". See: > + // https://bugs.gnu.org/41607 > + if (e.errNo =3D=3D ENOSPC || e.errNo =3D=3D EXDEV) { > printMsg(lvlInfo, format("note: can't create move `%1%':= %2%") % path % e.msg()); > deleteGarbage(state, path); > } For consistency with (most) of the code, I=E2=80=99d suggest a /* */ commen= t. Otherwise LGTM, thank you! Ludo=E2=80=99.