View Issue Details

IDProjectCategoryView StatusLast Update
0002583CentOS-5kernelpublic2008-02-01 19:57
Reporterdang 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version5.0 - x86_64 
Target VersionFixed in Version 
Summary0002583: NFS CREATE fails on hp-ux clients with kernel 2.6.18-53.1.4.el5
DescriptionHP-UX NFS clients fail creating a new file on a CentOS 5 NFS server updated with the 2.6.18-53.1.4.el5.

Example:

hp-ux$ cp anyfile /to/nfs/fs/on/centos5
hp-ux$ cp: cannot create anyfile: Permission denied
Additional InformationA tcpdump trace viewed with wireshark seems to indicate that the NFS CREATE call is made with Mode: UNCHECKED and with the initial file permission mode set to 00 on HP-UX clients. The NFS CREATE call returns a NFS3ERR_ACCES error, probably due to the initial permission mode set to 00 (none). This was not a problem on the base level CentOS 5 kernel.

tcpdump trace file attaced.
TagsNo tags attached.

Activities

2008-01-04 16:30

 

centos5-hpux.tcpdump (3,212 bytes)
dang

dang

2008-01-08 17:02

reporter   ~0006671

I have just discovered that this only happens when the backing filesystem is gfs. When using ext3 the HP-UX NFS clients work OK.
dang

dang

2008-01-21 19:47

reporter   ~0006734

Problem appears to be due to generic_permission returning -EACCES

I traced down the function that is returning the -EACCES error;

nfsd_proc_create
 nfsd_create_v3
  vfs_create - Note: the create returns OK
 nfsd_setattr
  notify_change
   generic_permission - Note: returns a -EACCES error!

 Apparently GFS is the only filesystem I tested calling this generic_permission. ext3 and XFS both do not call generic_permission and therefore do not fail. The file that is created from the HP-UX NFS client is set to mode=0 and with the correct owner calling vfs_create. Then, nfsd tries to set the attributes with nfsd_setattr but generic_permission returns -EACCES!

 I did not want to change generic_permission as I do not have the understanding of the kernel to feel comfortable changing a kernel function. I made a patch to change how nfsd reacts to the return code. I simply look for a return from notify_change of -EACCES and if the FSUID=InodeUID then ignore the error. The HP-UX NFS client now works.

 I will attach my simple patch file so that someone with more knowledge can look at this and provide a permanent fix for a future update.

2008-01-21 19:48

 

bmc-nfsd_setattr.patch (519 bytes)
--- vfs.c_save	2008-01-18 13:06:50.000000000 -0600
+++ vfs.c	2008-01-18 13:18:40.000000000 -0600
@@ -348,6 +348,11 @@
 	if (!check_guard || guardtime == inode->i_ctime.tv_sec) {
 		fh_lock(fhp);
 		err = notify_change(dentry, iap);
+		/* Allow access override if owner for HP-UX NFS client bug on GFS */
+		if (err == -EACCES & (current->fsuid == inode->i_uid)) {
+			printk (KERN_DEBUG "nfsd_setattr: Bug detected! Ignoring -EACCES error for owner\n");
+			err = 0;
+		}
 		err = nfserrno(err);
 		fh_unlock(fhp);
 	}
dang

dang

2008-02-01 19:57

reporter   ~0006798

Logged this same issue with the upstream bugzilla: #431253

Issue History

Date Modified Username Field Change
2008-01-04 16:30 dang New Issue
2008-01-04 16:30 dang File Added: centos5-hpux.tcpdump
2008-01-08 17:02 dang Note Added: 0006671
2008-01-21 19:47 dang Note Added: 0006734
2008-01-21 19:48 dang File Added: bmc-nfsd_setattr.patch
2008-02-01 19:57 dang Note Added: 0006798