[Bug 838200] New: PathInfo::exchange does not handle EXDEV errno
https://bugzilla.novell.com/show_bug.cgi?id=838200 https://bugzilla.novell.com/show_bug.cgi?id=838200#c0 Summary: PathInfo::exchange does not handle EXDEV errno Classification: openSUSE Product: openSUSE 12.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: libzypp AssignedTo: zypp-maintainers@forge.provo.novell.com ReportedBy: fcastelli@suse.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- Created an attachment (id=555514) --> (http://bugzilla.novell.com/attachment.cgi?id=555514) strace log Recently I have been running openSUSE and SLE as lxc containers using docker (http://docker.io). Everything works fine except for zypper refresh, which works fine only the 1st time a repository is refreshed. Further calls return without errors, but the changes made to the remote repository are not found by zypper. Using strace I found the reason of this issue. Preamble: the running container has / mounted using AUFS. First refresh of the repository: zypper has no entries inside of its cache for this repository. zypper downloads repository's metadata inside of a temporary directory and then moves it inside of the 'official' cache directory. Everything works fine. Further invocations of zypper refresh: when something changes zypper downloads repository's metadata to a temporary directory. Then zypper founds the old cached entries and swaps the temporary directory with the 'official' cache one. That makes the changes available to zypper. Unfortunately the 'swap directories' operation does not work inside of the running container. That happens because AUFS cannot handle rename(2) operations made against a non empty directory which is available in the original file system. Hence AUFS raises EXDEV errno, but zypper does not handle it properly: it doesn't neither fail with an error nor it performs the rename operation in a different way. According to AUFS documentation:
To rename(2) directory may return EXDEV even if both of src and tgt are on the same aufs. When the rename-src dir exists on multiple branches and the lower dir has child(ren), aufs has to copyup all his children. It can be recursive copyup. Current aufs does not support such huge copyup operation at one time in kernel space, instead produces a warning and returns EXDEV. Generally, mv(1) detects this error and tries mkdir(2) and rename(2) or copy/unlink recursively. So the result is harmless. If your application which issues rename(2) for a directory does not support EXDEV, it will not work on aufs. Also this specification is applied to the case when the src directroy exists on the lower readonly branch and it has child(ren).
It would be great to catch EXDEV errno and recursively handle all the files inside of the target directory. I've attached the strace log. Just grep for EXDEV to find the relevant part of it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com