cowbuilder deletes bind-mounted directories
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cowdancer (Debian) |
Fix Released
|
Unknown
|
|||
cowdancer (Ubuntu) |
Fix Released
|
Critical
|
Brian Murray |
Bug Description
If cowbuilder failed to unmount a bind-mounted directory (device busy for example) it unconditionally deletes its content during the clean-up phase.
Excerpt from a log with this bug (complete log attached)
=====
I: umounting /var/lib/
umount: /var/cache/
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
[...]
-> Cleaning COW directory
forking: rm -rf /var/cache/
rm: cannot remove `/var/cache/
rm: cannot remove `/var/cache/
rm: cannot remove `/var/cache/
=====
The 'rm' command must skip directories on other filesystems
This bug occurs when pbuilder fails to mount a bindmounted directory, then fails to unmount previously successfully mounted directories. This condition is not so rare when executing several cowbuilder processes in parallel using the same bind-mounted directories.
There is no easy way to reproduce this issue:
- Start several cowbuilder in parallel (in our system we run around 40) and bind mount the same source directories
- patch /usr/lib/
ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: cowbuilder 0.71
ProcVersionSign
Uname: Linux 3.8.0-12-generic x86_64
ApportVersion: 2.9.1-0ubuntu1
Architecture: amd64
Date: Mon Mar 18 11:08:38 2013
MarkForUpload: True
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: cowdancer
UpgradeStatus: Upgraded to raring on 2012-01-31 (411 days ago)
description: | updated |
description: | updated |
Changed in cowdancer (Debian): | |
status: | Unknown → New |
summary: |
- cowdancer deletes bind-mounted directories + cowbuilder deletes bind-mounted directories |
Changed in cowdancer (Ubuntu): | |
status: | New → Triaged |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in cowdancer (Debian): | |
status: | New → Fix Released |
This patch checks if a directory is mounted under the chroot and skips rmrf() if there is one.