Bug 758457

Summary: findmnt -O doesn't work as expected with 'no' options
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: jonathan, kzak, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-01 17:41:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bill Nottingham 2011-11-29 20:31:15 UTC
Description of problem:

$ findmnt -m -O nosuid
TARGET                     SOURCE                FSTYPE        OPTIONS
/proc                      proc                  proc          rw,relatime
/sys                       sysfs                 sysfs         rw,relatime,seclabel
/dev                       devtmpfs              devtmpfs      rw,nosuid,relatime,seclabel,size=3980808k,nr_inodes=995202,mode=755
/dev/pts                   devpts                devpts        rw,relatime,seclabel,gid=5,mode=620,ptmxmode=000
/dev/shm                   tmpfs                 tmpfs         rw,relatime,seclabel
/                          /dev/sda2             ext4          rw,noatime,nodiratime,seclabel,user_xattr,barrier=1,data=ordered
/run                       tmpfs                 tmpfs         rw,nosuid,nodev,relatime,seclabel,mode=755

Most of these filesystems aren't mounted with nosuid.

Similarly with 'noatime'

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

util-linux-2.20.1-2.fc16.x86_64

How reproducible:

100%

Steps to Reproduce:
1. play with findmnt

Comment 1 Karel Zak 2011-12-01 17:41:02 UTC
The "no" is interpreted as prefix, so the command returns all entries where is not "suid" option. This is expected behaviour...

Anyway, I have improved the pattern evaluation and now you can use "+" prefix to disable "no" prefix interpretation -- it means that "+noauto" will return entries where is *literally* "noauto" option:

$ findmnt --fstab -O "+noauto"
TARGET      SOURCE                   FSTYPE OPTIONS
/mnt/store  sr.net.home:/mnt/store   nfs    noauto
/mnt/loop   /home/fs-images/ext2.img auto   defaults,noauto

This change will available in the next upstream release (and F17).