Activity log for bug #1735046

Date Who What changed Old value New value Message
2017-11-29 03:02:49 Ryan Harper bug added bug
2017-11-29 23:01:20 Ryan Harper attachment added btrfs-tools-fix-lp1735046.debdiff https://bugs.launchpad.net/ubuntu/+source/btrfs-tools/+bug/1735046/+attachment/5016421/+files/btrfs-tools-fix-lp1735046.debdiff
2017-11-30 00:23:26 Ubuntu Foundations Team Bug Bot tags amd64 apport-bug curtin trusty uec-images amd64 apport-bug curtin patch trusty uec-images
2017-11-30 00:23:31 Ubuntu Foundations Team Bug Bot bug added subscriber Ubuntu Sponsors Team
2017-12-02 07:10:55 Mathew Hodson btrfs-tools (Ubuntu): importance Undecided Medium
2017-12-15 17:37:18 Ryan Harper description # lsb_release -rd Description: Ubuntu 14.04.5 LTS Release: 14.04 # apt-cache policy btrfs-tools btrfs-tools: Installed: 3.12-1ubuntu0.1 Candidate: 3.12-1ubuntu0.1 Version table: *** 3.12-1ubuntu0.1 0 500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages 100 /var/lib/dpkg/status 3.12-1 0 500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages # mkfs.btrfs --force /dev/vdd succeeds # # mkfs.btrfs --force /dev/vdd Error: error checking /dev/vdd mount status # strace -f mkfs.btrfs --force /dev/vdd <snip> stat("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0 lstat("/dev", {st_mode=S_IFDIR|0755, st_size=4180, ...}) = 0 lstat("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0 open("/sys/block//loop0/loop/backing_file", O_RDONLY) = 5 fstat(5, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe8bd73c000 read(5, "/root.tmp.img (deleted)\n", 4096) = 24 close(5) = 0 munmap(0x7fe8bd73c000, 4096) = 0 lstat("/dev", {st_mode=S_IFDIR|0755, st_size=4180, ...}) = 0 lstat("/dev/vdd", {st_mode=S_IFBLK|0660, st_rdev=makedev(253, 48), ...}) = 0 lstat("/root.tmp.img (deleted)", 0x7ffeaa3f0bf0) = -1 ENOENT (No such file or directory) close(4) = 0 munmap(0x7fe8bd73d000, 4096) = 0 close(3) = 0 write(2, "Error: error checking /dev/vdd m"..., 44Error: error checking /dev/vdd mount status ) = 44 exit_group(1) = ? +++ exited with 1 +++ It appears that mkfs.btrfs doesn't like the loop device, /dev/loop0 which has a deleted backing file. root@ubuntu:~# cat /sys/block/loop0/loop/backing_file /root.tmp.img (deleted) root@ubuntu:~# ls -al /root.tmp.img ls: cannot access /root.tmp.img: No such file or directory ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: btrfs-tools 3.12-1ubuntu0.1 ProcVersionSignature: Ubuntu 3.13.0-135.184-generic 3.13.11-ckt39 Uname: Linux 3.13.0-135-generic x86_64 ApportVersion: 2.14.1-0ubuntu3.27 Architecture: amd64 Date: Wed Nov 29 02:58:04 2017 ProcEnviron: TERM=vt102 PATH=(custom, no user) LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: btrfs-tools UpgradeStatus: No upgrade log present (probably fresh install) SRU Template [Impact] * Users may be unable to successfully create a btrfs filesystem on block devices when a loop device is mounted and the backing file no longer exists. This typically happens in the precense of overlayroot but may be encountered in other situations. This affects the btrfs-tools package prior to the 3.13 release. * Backporting the fix from the upstream repository is required to allow Trusty MAAS/Cloud images which use overlayrootfs to create btrfs filesystems in the presence of a loopdevice with a missing backing file. * All patches applied are already accepted upstream. Xenial, Artful, and Bionic are not affected. [Test Case] * On a Trusty 14.04 system with a secondary disk (vdb) - apt-get install btrfs-tools - truncate -s 1G testloop.img - losetup /dev/loop0 testloop.img - mkfs.ext4 /dev/loop0 - mount /dev/loop0 /mnt - rm testloop.img - mkfs.btrfs --force /dev/vdb PASS if mkfs.btrfs returns 0 and /dev/vdb has a btrfs filesystem FAIL if mkfs.btrfs returns non-zero and /dev/vdb does not have a btrfs filesystem. mkfs.btrfs returns the error message: Error: error checking /dev/vdb mount status [Regression Potential] * mkfs.btrfs fails to detect that the target device is already mounted and an existing btrfs filesystem is destroyed. [Original Description] # lsb_release -rd Description: Ubuntu 14.04.5 LTS Release: 14.04 # apt-cache policy btrfs-tools btrfs-tools:   Installed: 3.12-1ubuntu0.1   Candidate: 3.12-1ubuntu0.1   Version table:  *** 3.12-1ubuntu0.1 0         500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages         100 /var/lib/dpkg/status      3.12-1 0         500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages # mkfs.btrfs --force /dev/vdd succeeds # # mkfs.btrfs --force /dev/vdd Error: error checking /dev/vdd mount status # strace -f mkfs.btrfs --force /dev/vdd <snip> stat("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0 lstat("/dev", {st_mode=S_IFDIR|0755, st_size=4180, ...}) = 0 lstat("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0 open("/sys/block//loop0/loop/backing_file", O_RDONLY) = 5 fstat(5, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe8bd73c000 read(5, "/root.tmp.img (deleted)\n", 4096) = 24 close(5) = 0 munmap(0x7fe8bd73c000, 4096) = 0 lstat("/dev", {st_mode=S_IFDIR|0755, st_size=4180, ...}) = 0 lstat("/dev/vdd", {st_mode=S_IFBLK|0660, st_rdev=makedev(253, 48), ...}) = 0 lstat("/root.tmp.img (deleted)", 0x7ffeaa3f0bf0) = -1 ENOENT (No such file or directory) close(4) = 0 munmap(0x7fe8bd73d000, 4096) = 0 close(3) = 0 write(2, "Error: error checking /dev/vdd m"..., 44Error: error checking /dev/vdd mount status ) = 44 exit_group(1) = ? +++ exited with 1 +++ It appears that mkfs.btrfs doesn't like the loop device, /dev/loop0 which has a deleted backing file. root@ubuntu:~# cat /sys/block/loop0/loop/backing_file /root.tmp.img (deleted) root@ubuntu:~# ls -al /root.tmp.img ls: cannot access /root.tmp.img: No such file or directory ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: btrfs-tools 3.12-1ubuntu0.1 ProcVersionSignature: Ubuntu 3.13.0-135.184-generic 3.13.11-ckt39 Uname: Linux 3.13.0-135-generic x86_64 ApportVersion: 2.14.1-0ubuntu3.27 Architecture: amd64 Date: Wed Nov 29 02:58:04 2017 ProcEnviron:  TERM=vt102  PATH=(custom, no user)  LANG=en_US.UTF-8  SHELL=/bin/bash SourcePackage: btrfs-tools UpgradeStatus: No upgrade log present (probably fresh install)
2017-12-20 18:46:07 Scott Moser nominated for series Ubuntu Trusty
2017-12-20 18:46:07 Scott Moser bug task added btrfs-tools (Ubuntu Trusty)
2017-12-20 18:46:28 Scott Moser btrfs-tools (Ubuntu): status New Fix Released
2017-12-20 18:46:35 Scott Moser btrfs-tools (Ubuntu Trusty): status New In Progress
2017-12-20 18:46:38 Scott Moser btrfs-tools (Ubuntu Trusty): importance Undecided Medium
2017-12-20 18:46:45 Scott Moser btrfs-tools (Ubuntu Trusty): assignee Ryan Harper (raharper)
2017-12-20 18:47:17 Scott Moser nominated for series Ubuntu Xenial
2017-12-20 18:47:17 Scott Moser bug task added btrfs-tools (Ubuntu Xenial)
2017-12-20 18:47:24 Scott Moser btrfs-tools (Ubuntu Xenial): status New Fix Released
2017-12-20 18:47:28 Scott Moser btrfs-tools (Ubuntu Xenial): importance Undecided Medium
2017-12-21 17:20:10 Brian Murray btrfs-tools (Ubuntu Trusty): status In Progress Fix Committed
2017-12-21 17:20:12 Brian Murray bug added subscriber Ubuntu Stable Release Updates Team
2017-12-21 17:20:13 Brian Murray bug added subscriber SRU Verification
2017-12-21 17:20:17 Brian Murray tags amd64 apport-bug curtin patch trusty uec-images amd64 apport-bug curtin patch trusty uec-images verification-needed verification-needed-trusty
2018-01-05 22:57:34 Brian Murray removed subscriber Ubuntu Sponsors Team
2018-01-11 21:14:59 Ryan Harper tags amd64 apport-bug curtin patch trusty uec-images verification-needed verification-needed-trusty amd64 apport-bug curtin patch trusty uec-images verification-done-trusty verification-needed
2018-01-16 14:29:47 Scott Moser tags amd64 apport-bug curtin patch trusty uec-images verification-done-trusty verification-needed amd64 apport-bug curtin patch trusty uec-images verification-done verification-done-trusty
2018-01-17 13:15:59 Launchpad Janitor btrfs-tools (Ubuntu Trusty): status Fix Committed Fix Released
2018-01-17 13:16:06 Robie Basak removed subscriber Ubuntu Stable Release Updates Team