From 7859d98a321354bcb374cfd468b749d888a2c239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Mon, 9 Nov 2020 16:10:18 -0500 Subject: [PATCH] [unpackfs] Skip overlay extended attributes The module preserves the extended attributes at rsync and the overlay filesystem stores extended attributes by inodes. The overlay filesystem keeps traces of the lower directory by encoding and storing its UUID to the attribute trusted.overlay.origin. If the index feature is on, that attribute is compared to the UUID of the lower directory at every subsequent mounts and causes mount to fail with ESTATE if it does not match. This filters the namespace trusted.overlay.* by using the rsync option --filter='-x trusted.overlay.*' to make sure the overlays extended attributes are not preserved. Fixes: # mount -t overlay -o lowerdir=...,upperdir,...,workdir= overlay /mnt/etc mount: /var/mnt/etc: mount(2) system call failed: Stale file handle. # dmesg (...) overlayfs: "xino" feature enabled using 32 upper inode bits. overlayfs: failed to verify origin (/etc, ino=524292, err=-116) overlayfs: failed to verify upper root origin --- src/modules/unpackfs/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index a573cf6e7..085034b8d 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -181,7 +181,7 @@ def file_copy(source, entry, progress_cb): num_files_total_local = 0 num_files_copied = 0 # Gets updated through rsync output - args = ['rsync', '-aHAXr'] + args = ['rsync', '-aHAXr', '--filter=-x trusted.overlay.*'] args.extend(global_excludes()) if entry.excludeFile: args.extend(["--exclude-from=" + entry.excludeFile])