Debian Bug report logs - #836211
dpkg: Cannot upgrade some packages on overlayfs: Invalid cross-device link

version graph

Package: linux; Maintainer for linux is Debian Kernel Team <[email protected]>;

Affects: dpkg

Reported by: Felipe Sateler <[email protected]>

Date: Wed, 31 Aug 2016 15:18:06 UTC

Severity: normal

Tags: upstream

Found in versions 4.12.6-1, 4.6.4-1

Forwarded to [email protected]

Full log


🔗 View this message in rfc822 format

X-Loop: [email protected]
Subject: Bug#836211: dpkg: Cannot upgrade some packages on overlayfs: Invalid cross-device link
Reply-To: Miklos Szeredi <[email protected]>, [email protected]
Resent-From: Miklos Szeredi <[email protected]>
Resent-To: [email protected]
Resent-CC: Dpkg Developers <[email protected]>
X-Loop: [email protected]
Resent-Date: Fri, 02 Sep 2016 12:33:02 +0000
Resent-Message-ID: <[email protected]>
Resent-Sender: [email protected]
X-Debian-PR-Message: followup 836211
X-Debian-PR-Package: dpkg
X-Debian-PR-Keywords: 
X-Debian-PR-Source: dpkg
Received: via spool by [email protected] id=B836211.147281946715920
          (code B ref 836211); Fri, 02 Sep 2016 12:33:02 +0000
Received: (at 836211) by bugs.debian.org; 2 Sep 2016 12:31:07 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02
	(2014-02-07) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-5.2 required=4.0 tests=BAYES_00,DKIM_SIGNED,
	HAS_BUG_NUMBER,RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID,URIBL_CNKR
	autolearn=ham autolearn_force=no version=3.4.0-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 43; hammy, 150; neutral, 160; spammy,
	0. spammytokens: hammytokens:0.000-+--HX-Google-DKIM-Signature:in-reply-to,
	0.000-+--U*hertzog, 0.000-+--sk:hertzog, 0.000-+--hertzogdebianorg,
	[email protected]
Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230])
	by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1bfncg-00048B-Jb
	for [email protected]; Fri, 02 Sep 2016 12:31:07 +0000
Received: by mail-oi0-x230.google.com with SMTP id p186so123449718oia.2
        for <[email protected]>; Fri, 02 Sep 2016 05:31:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=szeredi.hu; s=google;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc;
        bh=XpKYxO3mXWUiSp4kTs8M68UBAGXD24d9d/ibY7dY0AE=;
        b=i07uyV7lTLQ0r6iyoxE7j4pFpJ/33yQ5NKrsVc4oAUsRmY+GFHmr+/lHldAyvcorBr
         1hNK/MG9dxPItK1+zkykhCzWc+q9kejb+UqPE63yzLfuZG7wv74rSfhPwF0seM1E0vnF
         5IAmJAiXa9kqu/4zVfzmrqd2Zxly17ed56z94=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:cc;
        bh=XpKYxO3mXWUiSp4kTs8M68UBAGXD24d9d/ibY7dY0AE=;
        b=aundnaOVKDyxUACu36UFXM/ZXYPWMkoLv+k7rnsp/EC6HQ/OSdNMTp439DtaGN9qlE
         Wreq0Dr+z5epFdz5Te9q4VNEi/KhK1djxZbul9GpGJpZftVAHwo3BlOcBn2ah8gVWhR9
         jl8cVYlQF2/xdBCZoBGFBmiyaGhEQCyKnSbccQ+zIxz32fJQSR/z/VUrtPsD0B37VnhF
         jSvcFAOFT7c6ck/u1xLnSNTw3PhemQVUoHTndNxJOQdGgPOJYT459B+PPAK6ZLP2vobQ
         J+C56rDyT84RiRUJIHSveJJ9Joa9qirD+GRbZraCwU3h19lt07aWlYChpRcy18RHTMEP
         YDvA==
X-Gm-Message-State: AE9vXwNfMl1I0pRdl+2HQFg7J7ZBRTSuXJOOCirciSkbIOTWF8CUevmD2/A4od9RIYY7tBFJ+WV9TygvEcRqLg==
X-Received: by 10.157.51.45 with SMTP id f42mr19469812otc.109.1472819459400;
 Fri, 02 Sep 2016 05:30:59 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.202.2.74 with HTTP; Fri, 2 Sep 2016 05:30:58 -0700 (PDT)
X-Originating-IP: [217.173.44.24]
In-Reply-To: <[email protected]>
References: <147265657047.31705.7496372748096616425.reportbug@felipepc> <[email protected]>
From: Miklos Szeredi <[email protected]>
Date: Fri, 2 Sep 2016 14:30:58 +0200
Message-ID: <CAJfpegu-JhRpDmzx1=fLsnL+=FTsAX21Up5A6s4eQFDPZ2ET3g@mail.gmail.com>
To: Raphael Hertzog <[email protected]>
Cc: Felipe Sateler <[email protected]>, [email protected], 
	"[email protected]" <[email protected]>
Content-Type: text/plain; charset=UTF-8
On Fri, Sep 2, 2016 at 1:36 PM, Raphael Hertzog <[email protected]> wrote:
> Hi,
>
> On Wed, 31 Aug 2016, Felipe Sateler wrote:
>> overlayfs does not support renaming directories when the directories
>> live in the lower filesystem:
> [...]
>> Unfortunately this means that dpkg fails at least in the case where a
>> directory is converted into a file: apt 1.3~rc2 moves
>> /usr/share/bug/apt/script to /usr/share/bug/apt . This causes dpkg to
>
> That's the change at the package level. The operation that fails
> at the dpkg level is rename('/usr/share/bug/apt', '/usr/share/bug/apt.dpkg-tmp').
>
>> fail when running in an overlayfs with the following error:
> [...]
>>  unable to move aside './usr/share/bug/apt' to install new version: Invalid cross-device link
>
> I got the same failure here but I also saw similar reports in a Kali live
> system where overlayfs is used for persistence (and with the upgrade
> of gedit). So that error is affecting many Kali users. It's not a
> very rare error (ex: https://bugs.kali.org/view.php?id=3473,
> https://bugs.kali.org/view.php?id=3476,
> https://bugs.kali.org/view.php?id=3361,
> https://bugs.kali.org/view.php?id=3365).
>
> I'm putting in copy the overlayfs kernel maintainer... Hello Miklos,
> that restriction above (cf
> https://github.com/torvalds/linux/blob/v4.8-rc2/fs/overlayfs/copy_up.c#L318-L322)
> is very problematic for us.
>
> Do you have plans to get rid of it?

You are the first to report that this quirk actually causes problems
in real life.

I have plans to fix this by adding a "redirector" attribute so that
copied up directories (and perhaps files) can refer to lower directory
that is found at a different ___location relative to the root of the
overlay from the ___location of the upper directory.

Maybe an example can make this more clear:

lower/foo/bar/baz
upper/foo/bar <- whiteout
upper/moved/here <- redirects to "foo/bar"

will result in the tree:

overlay/moved/here/baz

> It does not seem very correct to put the burden on user-space to be aware
> of overlayfs restrictions such as this one. Renaming a directory is
> not something that happens often in practice in the uses cases where
> we use overlayfs but it's still frequent enough to deserve better than
> a EXDEV error IMO and dpkg trying to rename "foo/" into "foo.dpkg-tmp/"
> is in its right to assume that this rename will not cross any device
> boundary.

The EXDEV trick  just works for mv(1), hence this didn't seem to be a
big issue in practice.

Thanks,
Miklos

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon May 12 02:45:58 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.