From nobody@FreeBSD.ORG  Thu Jul 13 23:48:22 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 6475437BFC9; Thu, 13 Jul 2000 23:48:22 -0700 (PDT)
Message-Id: <20000714064822.6475437BFC9@hub.freebsd.org>
Date: Thu, 13 Jul 2000 23:48:22 -0700 (PDT)
From: tolyar@mx.ru
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: Problem with NFS client in 4.0-STABLE
X-Send-Pr-Version: www-1.0

>Number:         19909
>Category:       kern
>Synopsis:       [nfs] Problem with NFS client in 4.0-STABLE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 13 23:50:01 PDT 2000
>Closed-Date:    Sat Jan 26 00:13:21 UTC 2008
>Last-Modified:  Sat Jan 26 00:13:21 UTC 2008
>Originator:     Zherdev Anatoly
>Release:        4.0-STABLE
>Organization:
>Environment:
FreeBSD machine_name 4.0-STABLE FreeBSD 4.0-STABLE #0: Fri Jun 23 14:11:48 MSD 2000     tolyar@machine_name:/usr/src/sys/compile/MACHINE  i386

>Description:
New problems with 4.0-S nfsv3 client (this problems not exist with 3.4-S)

If file have write only permisson we can't append it properly, with read+write
permissons all ok, this is serious error ...           

This was tested on a lot of clients 3.4-S and four 4.0-S clients
>How-To-Repeat:
Server:

/etc/exports:                                            
/mnt/test -maproot=0:0 nfsclient                                               

Client:
/etc/fstab:                                                       
nfsserver:/mnt/test /mnt/test nfs rw,nfsv3,mntudp,intr,rdirplus

> df                                                                            
Filesystem                      512-blocks     Used    Avail Capacity  Mounted n
/dev/da0s1a                        2781278  1484240  1074536    58%    /
procfs                                   8        8        0   100%    /proc
nfsserver:/mnt/test               52227808 43258416  4791168    90%    /mnt/test
>

For demonstration we create user: test

> id                                                                            
uid=10101(test) gid=10101(test) groups=10101(test)
> cd                                                                            
> pwd
/usr/home/test                                                             
> ls -al
total 4                                                  
drwx------   2 test  wheel  512 Jun 26 16:47 .                                 
drwxr-xr-x  10 root  wheel  512 Jun 26 14:55 ..
lrwxr-xr-x   1 root  wheel   24 Jun 26 16:25 nfs_link -> /mnt/test
-----w----   1 root  test     0 Jun 26 16:46 nonfs_file 
>

file: ~test/nonfs_file created on local filesystem, and                         
file: ~test/nfs_link/nfs_file created on nfs                            

when we append file on nfs we append succesfully only first record, and         
next records not apended :

> cd ~test/nfs_link/                  
> ls -al
total 16                                                                        
drwx------   2 test  test     512 Jun 26 16:50 .  
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..                               
-----w----   1 root  test       0 Jun 26 16:44 nfs_file
> echo 000 >> nfs_file                                                     
> ls -al
total 24                                                  
drwx------   2 test  test     512 Jun 26 16:50 .                                
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..
-----w----   1 root  test       4 Jun 26 16:59 nfs_file           
> echo 111 >> nfs_file 
> ls -al
total 24
drwx------   2 test  test     512 Jun 26 16:50 .                                
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..                       
-----w----   1 root  test       8 Jun 26 16:59 nfs_file
> echo 222 >> nfs_file                                                          
> ls -al                  
total 24
drwx------   2 test  test     512 Jun 26 16:50 .
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..
-----w----   1 root  test       8 Jun 26 16:59 nfs_file                         
> echo 333 >> nfs_file                            
> ls -al                                                                        
total 24                                               
drwx------   2 test  test     512 Jun 26 16:50 .                           
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..
-----w----   1 root  test       8 Jun 26 16:59 nfs_file   
>

file contain only first record:                                   
# cat ~test/nfs_link/nfs_file
000     
#

and after reading we see new file size!                

> ls -al                  
total 24
drwx------   2 test  test     512 Jun 26 16:50 .
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..
-----w----   1 root  test       4 Jun 26 16:59 nfs_file                         
>

with rw permissions no problems exists:                

> ls -al                                         
total 16                                                  
drwx------   2 test  test     512 Jun 26 16:50 .
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..
----rw----   1 root  test       0 Jun 26 17:24 nfs_file           
>
> echo 000 >> nfs_file
> ls -al
total 24
drwx------   2 test  test     512 Jun 26 16:50 .
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..      
----rw----   1 root  test       4 Jun 26 17:25 nfs_file
> echo 111 >> nfs_file    
> ls -al
total 24                                        
drwx------   2 test  test     512 Jun 26 16:50 .
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..                               
----rw----   1 root  test       8 Jun 26 17:25 nfs_file
> echo 222 >> nfs_file
> ls -al                                               
total 24
drwx------   2 test  test     512 Jun 26 16:50 . 
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..         
----rw----   1 root  test      12 Jun 26 17:25 nfs_file
> echo 333 >> nfs_file                           
> ls -al                                                          
total 24
drwx------   2 test  test     512 Jun 26 16:50 .
dr-xr-xr-x  10 root  olsites  512 Jun 26 16:30 ..
----rw----   1 root  test      16 Jun 26 17:26 nfs_file
>

# cat ~test/nfs_link/nfs_file                          
000                       
111     
222                                             
333                                             
#

without nfs no problems exists:

> echo 000 >> nonfs_file
> ls -al                                         
total 6                                                   
drwx------   2 test  wheel  512 Jun 26 16:47 .         
drwxr-xr-x  10 root  wheel  512 Jun 26 14:55 ..  
lrwxr-xr-x   1 root  wheel   24 Jun 26 16:25 nfs_link -> /mnt/pub/root/roots/tet
-----w----   1 root  test     4 Jun 26 16:51 nonfs_file
> echo 111 >> nonfs_file                        
> ls -al                                         
total 6                                                
drwx------   2 test  wheel  512 Jun 26 16:47 .
drwxr-xr-x  10 root  wheel  512 Jun 26 14:55 ..
lrwxr-xr-x   1 root  wheel   24 Jun 26 16:25 nfs_link -> /mnt/pub/root/roots/tet
-----w----   1 root  test     8 Jun 26 16:51 nonfs_file
> echo 222 >> nonfs_file
> ls -al                                        
total 6                                         
drwx------   2 test  wheel  512 Jun 26 16:47 .
drwxr-xr-x  10 root  wheel  512 Jun 26 14:55 ..
lrwxr-xr-x   1 root  wheel   24 Jun 26 16:25 nfs_link -> /mnt/pub/root/roots/tet
-----w----   1 root  test    12 Jun 26 16:51 nonfs_file
>

# cat ~test/nonfs_file                                    
000                                                    
111                                              
222                                                                             
#



>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dillon 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Jul 17 09:54:40 PDT 2000 
Responsible-Changed-Why:  
Among others, Matt has a hat with NFS embroidered on it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19909 
Responsible-Changed-From-To: dillon->freebsd-bugs 
Responsible-Changed-By: keramida 
Responsible-Changed-When: Sat Feb 22 18:15:22 PST 2003 
Responsible-Changed-Why:  
Back to the free pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19909 
State-Changed-From-To: open->feedback 
State-Changed-By: kmacy 
State-Changed-When: Fri Nov 16 08:43:56 UTC 2007 
State-Changed-Why:  

Is this problem still present? This seems like something fsx would catch and it 
has not been observed on recent releases. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19909 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Jan 26 00:12:56 UTC 2008 
State-Changed-Why:  
Feedback timeout (2 months). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19909 
>Unformatted:
