Bug 1220915

Summary: regression in overlayfs on 4.0
Product: [Fedora] Fedora Reporter: Vincent Batts <vbatts>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: dhowells, gansalmon, ikent, itamar, jonathan, kernel-maint, madhu.chinakonda, mchehab
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-4.0.4-300.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-26 03:38:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vincent Batts 2015-05-12 19:52:42 UTC
Description of problem:
rmdir of a non-empty directory, that has a whiteout, will remove successfully.

Version-Release number of selected component (if applicable):
4.0.2-300.fc22.x86_64

How reproducible:
consistent

Steps to Reproduce:
```
base=$(mktemp -d)
echo ${base}

## make an overlay fs setup
mkdir -p ${base}/{upper,work,merged,mnt,lower}

## make an empty directory in the base layer
mkdir ${base}/lower/empty

## mount the base layer
sudo mount \
        -t overlay \
        -o rw,lowerdir=${base}/lower/,workdir=${base}/work/,upperdir=${base}/upper/ \
        ${base}/merged/ ${base}/mnt/

## create a whiteout
rmdir ${base}/mnt/empty

## add the dir back (on top of the whiteout)
mkdir -p ${base}/mnt/empty
touch ${base}/mnt/empty/file.txt

## now rm the non-empty directory
rmdir ${base}/mnt/empty && echo "bug here!"

## cleanup and info
sudo umount ${base}/mnt
sudo find ${base}

```

Actual results:
rmdir removes the non-empty directory and returns success

Expected results:
failure to rmdir the non-empty directory


Additional info:
Found in a docker issue report - https://github.com/docker/docker/issues/13108

Comment 1 Josh Boyer 2015-05-14 12:22:16 UTC
Added the patch from upstream in Fedora git.

Comment 2 Fedora Update System 2015-05-19 11:39:59 UTC
kernel-4.0.4-300.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/kernel-4.0.4-300.fc22

Comment 3 Fedora Update System 2015-05-20 02:52:44 UTC
Package kernel-4.0.4-300.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kernel-4.0.4-300.fc22'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-8534/kernel-4.0.4-300.fc22
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2015-05-26 03:38:27 UTC
kernel-4.0.4-300.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.