Bug 1273365

Summary: Can't unmount a container image previously mounted with atomic mount
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: atomic-bugs, dwalsh, lsm5, ovasik, walters
Target Milestone: rcKeywords: Extras, Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: atomic-1.6-1.gitca1e384.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1274518 (view as bug list) Environment:
Last Closed: 2016-03-31 23:25:08 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 Alex Jia 2015-10-20 09:45:30 UTC
Description of problem:
Can't unmount a container image previously mounted with atomic mount, and got error "Device mounted at /mnt is not a docker container."

Version-Release number of selected component (if applicable):
[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic host status
  TIMESTAMP (UTC)         VERSION   ID             OSNAME               REFSPEC                                                        
* 2015-10-15 09:13:14     7.1.6     9f139ac644     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard     
  2015-02-19 20:26:26     7.1.0     5799825b36     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard    
 
[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ rpm -q atomic docker
atomic-1.5-4.git7e4365f.el7.x86_64
docker-1.8.2-7.el7.x86_64


How reproducible:
always

Steps to Reproduce:
1. atomic update busybox
2. atomic mount <image_id> /mnt
3. atomic unmount /mnt
or 
   atomic unmount /var/mnt

Actual results:

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic update busybox
Using default tag: latest
Trying to pull repository registry.access.redhat.com/busybox ... not found
Trying to pull repository docker.io/library/busybox ... latest: Pulling from library/busybox
718495ebac5c: Pull complete 
0064fda8c45d: Pull complete 
library/busybox:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:3ebe07818fc2a8001cbb672b878ab0b81f047066093bb9c3f05600514710b921
Status: Downloaded newer image for docker.io/busybox:latest

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic images
 REPOSITORY                          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
 docker.io/busybox                   latest              0064fda8c45d        2015-10-14 19:36    1.11 MB     

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic mount 0064fda8c45d /mnt
[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo df | grep mnt
/dev/dm-4                  10474496    1888  10472608   1% /var/mnt

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo grep mnt /proc/mounts
/dev/mapper/docker-253:0-2905705-8a2542a055de6d5c982a6c02fdd05163ee48553eedcc2e898c2f5c4f7ebc20e2 /var/mnt xfs ro,context="system_u:object_r:svirt_sandbox_file_t:s0:c765,c1004",nosuid,nodev,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota 0 0
/dev/mapper/docker-253:0-2905705-8a2542a055de6d5c982a6c02fdd05163ee48553eedcc2e898c2f5c4f7ebc20e2 /var/mnt xfs ro,context="system_u:object_r:svirt_sandbox_file_t:s0:c765,c1004",nosuid,nodev,relatime,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota 0 0

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic unmount /mnt
Device mounted at /mnt is not a docker container.

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic unmount /var/mnt
Device mounted at /var/mnt is not a docker container.

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ df | grep mnt
/dev/dm-4                  10474496    1888  10472608   1% /var/mnt


Expected results:

Can unmount a container image previously mounted with atomic mount

Additional info:

It's okay on 7.1.5 RHEL Atomic OSTree, it should be a regression bug.

Comment 2 Daniel Walsh 2015-10-20 16:10:15 UTC
Is the backend the same both devmapper?  Or is this on overlayfs?

Comment 3 Alex Jia 2015-10-21 03:26:47 UTC
(In reply to Daniel Walsh from comment #2)
> Is the backend the same both devmapper?  Or is this on overlayfs?

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ rpm -q kernel
kernel-3.10.0-229.14.1.el7.x86_64
[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ lsmod|grep -i overlay
[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ dmesg|grep -i overlay
[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo docker info | grep -i -A3 storage 
Storage Driver: devicemapper
 Pool Name: atomicos-docker--pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: xfs

Comment 4 Daniel Walsh 2015-10-21 16:06:37 UTC
Brent does the latest fix for atomic unmount fix this problem?

Comment 7 Brent Baude 2015-10-22 18:29:24 UTC
(In reply to Daniel Walsh from comment #4)
> Brent does the latest fix for atomic unmount fix this problem?

Yes, I believe it will. I also just submitted a new PR to fix a bug related to atomic mount and XFS ... which default RHEL/Atomic is.  Would be prudent to pick that one up too.

Comment 8 Daniel Walsh 2015-10-22 18:56:43 UTC
Fixed in atomic-1.6

Comment 11 Alex Jia 2015-10-23 08:21:14 UTC
This issue has been verified on atomic-1.6-1.gitca1e384.el7.x86_64, so move the bug to verified status, the test details as follows.

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic host status
  TIMESTAMP (UTC)         VERSION               ID             OSNAME               REFSPEC                                                               
* 2015-10-23 07:19:49     7.2.internal.0.47     4bd90ff2fd     rhel-atomic-host     rhelah-autobuild:rhel-atomic-host/7.2/x86_64/autobrew/buildmaster     
  2015-10-15 09:13:14     7.1.6                 9f139ac644     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard            

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ rpm -q atomic
atomic-1.6-1.gitca1e384.el7.x86_64

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic images
 REPOSITORY                          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
 docker.io/busybox                   latest              0064fda8c45d        2015-10-14 19:36    1.11 MB  
   
[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic mount busybox /mnt

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ df -hT
Filesystem                Type      Size  Used Avail Use% Mounted on
/dev/mapper/atomicos-root xfs       3.0G  2.1G  866M  72% /
devtmpfs                  devtmpfs  902M     0  902M   0% /dev
tmpfs                     tmpfs     921M     0  921M   0% /dev/shm
tmpfs                     tmpfs     921M  304K  920M   1% /run
tmpfs                     tmpfs     921M     0  921M   0% /sys/fs/cgroup
/dev/vda1                 xfs       297M  139M  159M  47% /boot
tmpfs                     tmpfs     185M     0  185M   0% /run/user/1000
/dev/dm-4                 xfs        10G  1.9M   10G   1% /var/mnt

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ sudo atomic unmount /mnt

[cloud-user@plat-infra-382a4f35-aa37-447b-a7f6-c8b8181165fd ~]$ df -hT
Filesystem                Type      Size  Used Avail Use% Mounted on
/dev/mapper/atomicos-root xfs       3.0G  2.1G  866M  72% /
devtmpfs                  devtmpfs  902M     0  902M   0% /dev
tmpfs                     tmpfs     921M     0  921M   0% /dev/shm
tmpfs                     tmpfs     921M  300K  920M   1% /run
tmpfs                     tmpfs     921M     0  921M   0% /sys/fs/cgroup
/dev/vda1                 xfs       297M  139M  159M  47% /boot
tmpfs                     tmpfs     185M     0  185M   0% /run/user/1000

Comment 14 errata-xmlrpc 2016-03-31 23:25:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0527.html