From 6372310d053a2e75a4850f990499161a29e9bf8c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:59:34 +0200 Subject: Adding patch from Raphaël Hertzog to fallback on /bin/mv when rename syscall fails with EXDEV (Closes: #836211). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Baumann --- debian/patches/progress-linux/0001-overlayfs.patch | 35 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 36 insertions(+) create mode 100644 debian/patches/progress-linux/0001-overlayfs.patch create mode 100644 debian/patches/series (limited to 'debian/patches') diff --git a/debian/patches/progress-linux/0001-overlayfs.patch b/debian/patches/progress-linux/0001-overlayfs.patch new file mode 100644 index 0000000..ca0b9fc --- /dev/null +++ b/debian/patches/progress-linux/0001-overlayfs.patch @@ -0,0 +1,35 @@ +Author: Raphaël Hertzog +Description: Fallback on /bin/mv when rename syscall fails with EXDEV (Closes: #836211). + Work-around EXDEV error returned by overlayfs when trying to move away a + directory by calling "mv" which will do a full copy of the tree followed + by a removal of the source tree. + +diff -Naurp dpkg.orig/src/main/archives.c dpkg/src/main/archives.c +--- dpkg.orig/src/main/archives.c ++++ dpkg/src/main/archives.c +@@ -1034,6 +1034,25 @@ tarobject(struct tar_archive *tar, struc + if (rename(fnamevb.buf,fnametmpvb.buf)) + ohshite(_("unable to move aside '%.255s' to install new version"), + ti->name); ++ if (rename(fnamevb.buf,fnametmpvb.buf)) { ++ if (errno == EXDEV) { ++ struct command cmd; ++ pid_t pid; ++ ++ command_init(&cmd, "mv", "move directory aside"); ++ command_add_args(&cmd, "mv", fnamevb.buf, fnametmpvb.buf, NULL); ++ pid = subproc_fork(); ++ ++ if (pid == 0) ++ command_exec(&cmd); ++ ++ subproc_reap(pid, "mv", 0); ++ command_destroy(&cmd); ++ } else { ++ ohshite(_("unable to move aside '%.255s' to install new version"), ++ ti->name); ++ } ++ } + } else if (S_ISLNK(stab.st_mode)) { + int rc; + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..39ab66d --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +progress-linux/0001-overlayfs.patch -- cgit v1.2.3