Hi all,

Please code review following simple fix (two new lines added):
http://cr.opensolaris.org/~aragorn/6887850-nfsstat-forcedirectio/

Background
==========

We have support for directio functionality (including forcedirectio mount flag)
for very long time (since Solaris 8, or so). When the functionality was
integrated the author forgot to update nfsstat tool to have the
forcedirectio flag printed. So till today we are not able to check the
forcedirectio using 'nfsstat -m' command. This can sometimes confuse
people (like myself :-).

So I created this simple fix with the missing support added.

Please note the HP-UX seems to have similar support:
http://docs.hp.com/en/B3921-60631/nfsstat.1M.html

I also asked our manpage gurus to have this "new" flag documented:
CR 6888023 nfsstat: "forcedirectio" mount flag needs to be documented

Tests
=====

(sparc)

# uname -a
SunOS s4u-nv-gmp03 5.11 snv_124 sun4u sparc sun4u
# nfsstat -m /tmp/test
/tmp/test from snvx.czech:/builds
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

# 
/net/snvs.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build/usr/src/cmd/fs.d/nfs/nfsstat/nfsstat
 -m /tmp/test
/tmp/test from snvx.czech:/builds
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,forcedirectio,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

# nfsstat -m /net/snvs.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build
/net/snvs.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build from 
snvs.czech:/builds/mt198684/6887850-nfsstat-forcedirectio-build
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

# 
/net/snvs.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build/usr/src/cmd/fs.d/nfs/nfsstat/nfsstat
 -m /net/snvs.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build
/net/snvs.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build from 
snvs.czech:/builds/mt198684/6887850-nfsstat-forcedirectio-build
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

# mount |grep test
/tmp/test on snvx.czech:/builds 
remote/read/write/setuid/devices/forcedirectio/xattr/dev=6100005 on Mon Oct  5 
08:48:09 2009
# mount |grep 6887850
/net/snvs.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build on 
snvs.czech:/builds/mt198684/6887850-nfsstat-forcedirectio-build 
remote/read/write/nosetuid/nodevices/noquota/xattr/dev=610000b on Mon Oct  5 
09:04:28 2009
#

(x86)

# uname -a
SunOS tortuga 5.11 snv_124 i86pc i386 i86pc
# nfsstat -m /tmp/test /tmp/test2
/tmp/test from va64-v20zh-prg06.czech:/export/test
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

/tmp/test2 from va64-v20zh-prg06.czech:/export/test
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

# 
/net/snvx.czech/builds/mt198684/6887850-nfsstat-forcedirectio-build/usr/src/cmd/fs.d/nfs/nfsstat/nfsstat
 -m /tmp/test /tmp/test2
/tmp/test from va64-v20zh-prg06.czech:/export/test
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,forcedirectio,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

/tmp/test2 from va64-v20zh-prg06.czech:/export/test
 Flags:         
vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

# mount |grep test
/tmp/test on va64-v20zh-prg06.czech:/export/test 
remote/read/write/setuid/devices/forcedirectio/xattr/dev=6140006 on Pi okt  2 
16:55:32 2009
/tmp/test2 on va64-v20zh-prg06.czech:/export/test 
remote/read/write/setuid/devices/noforcedirectio/xattr/dev=6140007 on Pi okt  2 
16:56:25 2009
#



Thanks.

-- 
Marcel Telka
Solaris RPE

Reply via email to