When using sysupgrade with "-k" to include a list of installed packages in the backup, a mounting error is both logged to console and to log.
======How to reproduce:======
Do backup with "-k"
root@router:~# /sbin/sysupgrade -k -b /mnt/sda1/backup.tar.gz
mount: mounting overlay on /etc/backup failed: Invalid argument
Cannot mount '/etc/backup' as tmpfs to avoid touching disk while saving the list of installed packages.
Tue Sep 21 16:12:05 CEST 2021 upgrade: Saving config files...
It does not matter where to backup,the same errors show up when using sysupgrade -k -b - >/dev/null to backup to stdout.
Show kernel error from log:
root@router:~# logread | grep kern.err
TueSep 21 16:12:05 2021 kern.err kernel: [539662.073867] overlayfs: maximum fs stacking depth exceeded
Apparently, when sysupgrade is interrupted, it does not clean up after itself, leaving /tmp/sysupgrade.XXXXXX folders and possibly (if called with "-k") a mount on /etc/backup behind.
Last line of the output of mount after interrupting "sysupgrade -k".
overlay on /etc/backup type overlay (rw,relatime,lowerdir=/etc/backup,upperdir=/tmp/sysupgrade.jlomom/upper,workdir=/tmp/sysupgrade.jlomom/work)
The next call to "sysupgrade -k" generates the mount-errors since /etc/backup is then already mounted, but with the wrong folder.