Bug 1357746

Summary: mount -av" report NFS "successfully mounted" but it is not.
Product: Red Hat Enterprise Linux 7 Reporter: Ashima Rawat <arawat>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Radka Brychtova <rskvaril>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: rskvaril
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: util-linux-2.23.2-36.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 21:41:11 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:
Bug Depends On:    
Bug Blocks: 1298243, 1380361, 1393867    

Description Ashima Rawat 2016-07-19 04:27:14 UTC
Description of problem:
mount -av" report NFS "successfully mounted" in RHEL 7.2 with util-linux-2.23.2-26.el7_2.2.x86_64 but it is not.

Version-Release number of selected component (if applicable):

RHEL 7.2 3.10.0-327.13.1.el7.x86_64
util-linux-2.23.2-26.el7_2.2.x86_64

Steps to Reproduce:

[root@dhcp233-147 ~]# cat /etc/exports
/iptvstage	*(rw,sync)

[root@dhcp8-30 ~]# grep -i iptvstage /etc/fstab
10.65.2.185:/iptvstage		/iptvstage		nfs	 defaults,intr,_netdev	  0 0

[root@dhcp8-30 ~]# mount -a
mount.nfs: mount point /iptvstage does not exist <--------

[root@dhcp8-30 ~]# mount -av
/                        : ignored
/boot                    : already mounted
swap                     : ignored
mount.nfs: mount point /iptvstage does not exist
/iptvstage               : successfully mounted <----------shows as mounted 

man page of mount:

       -v, --verbose
              Verbose mode.

       -a, --all
              Mount all filesystems (of the given types) mentioned in fstab.


But if you see df-h, /proc/mounts output it doesnt get mounted.

[root@dhcp8-30 ~]# df -h
Filesystem                       Size  Used Avail Use% Mounted on
/dev/mapper/rhel_dhcp8--30-root  4.0G  1.4G  2.6G  35% /
devtmpfs                         486M     0  486M   0% /dev
tmpfs                            496M     0  496M   0% /dev/shm
tmpfs                            496M   57M  440M  12% /run
tmpfs                            496M     0  496M   0% /sys/fs/cgroup
/dev/vda1                        497M  125M  373M  26% /boot
tmpfs                            100M     0  100M   0% /run/user/0

[root@dhcp8-30 ~]# grep -i iptvstage /proc/mounts
[root@dhcp8-30 ~]# ls /iptvstage
ls: cannot access /iptvstage: No such file or directory

Actual results: mount -av showing as mounted which is incorrect.
[root@dhcp8-30 ~]# mount -av
/                        : ignored
/boot                    : already mounted
swap                     : ignored
mount.nfs: mount point /iptvstage does not exist
/iptvstage               : successfully mounted 

Expected results:
mount -av
/                        : ignored
/boot                    : already mounted
swap                     : ignored
mount.nfs: mount point /iptvstage does not exist


Additional info:

The "successfully mounted" message came from the following code:

util-linux-2.23.2/sys-utils/mount.c

 173 static int mount_all(struct libmnt_context *cxt)
 174 {
...
 199                 } else {
 200                         mk_exit_code(cxt, mntrc);       /* to print warning     s */
 201 
 202                         if (mnt_context_get_status(cxt)) {
 203                                 nsucc++;
 204 
 205                                 if (mnt_context_is_verbose(cxt))
 206                                         printf("%-25s: successfully mounted     
", tgt);
 207                         } else
 208                                 nerrs++;
 209                 }
...

This is because mnt_context_get_status(cxt) is constantly true for NFS mounts. Its code:

util-linux-2.23.2/libmount/src/context.c

1982 int mnt_context_get_status(struct libmnt_context *cxt)
1983 {
1984         assert(cxt);
1985         return !cxt->syscall_status || !cxt->helper_exec_status;
1986 }

Comment 2 Karel Zak 2016-07-19 08:00:09 UTC
Yes, the current upstream code also cares about mk_exit_code() result (where we check status of the helper). Upstream commit 8ab82185eed76bc20694a197fe10c5f9fb795b80.


Note that I don't think that the incorrect verbose message is a urgent issue.

Comment 8 errata-xmlrpc 2017-08-01 21:41:11 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://access.redhat.com/errata/RHBA-2017:2186