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: Raphael Hertzog <[email protected]>, [email protected]
Resent-From: Raphael Hertzog <[email protected]>
Resent-To: [email protected]
Resent-CC: Dpkg Developers <[email protected]>
X-Loop: [email protected]
Resent-Date: Fri, 02 Sep 2016 11:39: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.147281619726753
          (code B ref 836211); Fri, 02 Sep 2016 11:39:02 +0000
Received: (at 836211) by bugs.debian.org; 2 Sep 2016 11:36:37 +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=-9.0 required=4.0 tests=BAYES_00,FROMDEVELOPER,
	HAS_BUG_NUMBER,HEADER_FROM_DIFFERENT_DOMAINS,MURPHY_DRUGS_REL8,
	RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,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, 13; hammy, 149; neutral, 146; spammy,
	1. spammytokens:0.987-1--H*r:210f hammytokens:0.000-+--H*r:e35,
	0.000-+--H*RU:e35, 0.000-+--Hx-spam-relays-external:e35,
	0.000-+--H*F:U*hertzog, 0.000-+--H*rp:U*raphael
Received: from mail.vm.ouaza.com ([212.83.178.2])
	by buxtehude.debian.org with esmtp (Exim 4.84_2)
	(envelope-from <[email protected]>)
	id 1bfmlw-0006xB-Gy
	for [email protected]; Fri, 02 Sep 2016 11:36:37 +0000
Received: from x230-buxy.home.ouaza.com (unknown [IPv6:2a01:e35:8a8d:92d0:19ff:210f:d952:f99f])
	by mail.vm.ouaza.com (Postfix) with ESMTPSA id 7F4512039D;
	Fri,  2 Sep 2016 13:36:34 +0200 (CEST)
Received: by x230-buxy.home.ouaza.com (Postfix, from userid 1000)
	id A85D0D22735; Fri,  2 Sep 2016 13:36:33 +0200 (CEST)
Date: Fri, 2 Sep 2016 13:36:33 +0200
From: Raphael Hertzog <[email protected]>
To: Felipe Sateler <[email protected]>, [email protected]
Cc: Miklos Szeredi <[email protected]>
Message-ID: <[email protected]>
References: <147265657047.31705.7496372748096616425.reportbug@felipepc>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <147265657047.31705.7496372748096616425.reportbug@felipepc>
User-Agent: NeoMutt/ (1.7.0)
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
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?

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.

I'm happy to test out kernel patches if I can help you in the process
of getting a fix.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon May 12 02:43:56 2025; Machine Name: buxtehude

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.