OverlayFS: Wrong mnt_id and path reported in /proc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Trusty |
Won't Fix
|
Medium
|
Unassigned | ||
Vivid |
Fix Released
|
Medium
|
Chris J Arges |
Bug Description
SRU Justification:
[Impact]
I am running Ubuntu Vivid (3.19.0-22-generic #22-Ubuntu SMP Tue Jun 16 17:15:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux). There are two issues in OverlayFS as follows:
1. /proc/<
2. /proc/<pid>/fd/<fd> shows incorrect path for the symlink target
[Fix]
These problems can be easily reproduced with the shell script below. Fortunately, both problems have been fixed in the upstream's master branch of the kernel via the following commits:
torvalds 4.0: 155e35d4d VFS: Introduce inode-getting helpers for layered/unioned fs environments (this is already in ubuntu-vivid)
torvalds 4.0: df1a085af VFS: Add a fallthrough flag for marking virtual dentries
torvalds 4.2-rc2: f25801ee4 overlay: Call ovl_drop_write() earlier in ovl_dentry_open()
torvalds 4.2-rc2: 4bacc9c92 overlayfs: Make f_path always point to the overlay and f_inode to the underlay
torvalds 4.2-rc2: 9391dd00d fix a braino in ovl_d_select_
(The commit df1a085af may technically not be needed but it prevents a conflict when applying 4bacc9c92.)
[Test Case]
Simple script to reproduce the problem:
#!/bin/bash
set -eu
ERROR=0
setup() {
setup_mount
start_python > /dev/null 2>&1 &
BASH_PID=$!
PYTHON_PID=$(ps -C python | awk '/python/ { print $1 }')
sleep 1
}
setup_mount() {
mkdir overlay_test
cd overlay_test
mkdir a b c z
sudo mount -t overlay -o lowerdir=
}
start_python() {
python << EOF
import time
fd = open("z/file", "w")
time.sleep(10)
EOF
}
check_path() {
WD=$(pwd)
if ! ls -l /proc/$
ERROR=1
echo "ERROR! expected $WD/z/file"
set -x
ls -l /proc/$
set +x
fi
}
check_mnt_id() {
FDINFO_
MOUNTINFO_
if [[ $FDINFO_MNT_ID -ne $MOUNTINFO_MNT_ID ]]; then
ERROR=1
echo "ERROR! mnt_id $FDINFO_MNT_ID not in /proc/self/
set -x
cat /proc/$
cat /proc/self/
set +x
fi
}
finish() {
kill -INT $PYTHON_PID > /dev/null 2>&1
sudo umount z
cd $ORIG_WD
rm -rf overlay_test
}
main() {
ORIG_WD=$(pwd)
setup
check_path
check_mnt_id
finish
[[ $ERROR -eq 0 ]] && echo "OverlayFS looks good."
}
main
Related branches
Changed in linux (Ubuntu): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu Vivid): | |
importance: | Undecided → Medium |
tags: | added: kernel-da-key vivid |
tags: | added: bot-stop-nagging |
Changed in linux (Ubuntu): | |
status: | Incomplete → Triaged |
Changed in linux (Ubuntu Vivid): | |
status: | Incomplete → Triaged |
Changed in linux (Ubuntu Vivid): | |
assignee: | nobody → Chris J Arges (arges) |
description: | updated |
Changed in linux (Ubuntu Vivid): | |
status: | Triaged → Fix Committed |
Changed in linux (Ubuntu Trusty): | |
assignee: | nobody → Chris J Arges (arges) |
importance: | Undecided → Medium |
status: | Confirmed → In Progress |
Changed in linux (Ubuntu): | |
status: | Triaged → Fix Released |
Changed in linux (Ubuntu Trusty): | |
assignee: | Chris J Arges (arges) → nobody |
status: | In Progress → Won't Fix |
This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1479468
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.