Bug 19909

Summary: [nfs] Problem with NFS client in 4.0-STABLE
Product: Base System Reporter: tolyar <tolyar>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   

Description tolyar 2000-07-14 07:50:01 UTC
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                                                                             
#
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-17 17:54:40 UTC
Responsible Changed
From-To: freebsd-bugs->dillon

Among others, Matt has a hat with NFS embroidered on it.
Comment 2 Giorgos Keramidas freebsd_committer freebsd_triage 2003-02-23 02:15:22 UTC
Responsible Changed
From-To: dillon->freebsd-bugs

Back to the free pool.
Comment 3 K. Macy freebsd_committer freebsd_triage 2007-11-16 08:43:56 UTC
State Changed
From-To: open->feedback


Is this problem still present? This seems like something fsx would catch and it 
has not been observed on recent releases.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2008-01-26 00:12:56 UTC
State Changed
From-To: feedback->closed

Feedback timeout (2 months).