2006-11-01 02:17:04

by Ingo Saitz

[permalink] [raw]
Subject: PROBLEM: can't mkdir() in 2.6.19-rc3

[1.] One line summary of the problem:

Can't call mkdir() on 2.6.19-r3 nfsd


[2.] Full description of the problem/report:

When I call "mkdir foo" on an nfs mounted volume, the strace of mkdir shows

mkdir("foo", 0777) = -1 EPERM (Operation not permitted)

and the command fails. But if I do a "ls -ld foo" afterwards, the directory got
created:

drwxr-xr-x 2 ingo ingo 4096 2006-11-01 02:54 foo

The server is running 2.6.19-rc3, the client 2.6.18. The version of the
nfs-kernel-server ist 1.0.10. This did work with 2.6.18 as nfs server.


[3.] Keywords (i.e., modules, networking, kernel):

nfsd, mkdir, EPERM, 2.6.19-rc3


[4.] Kernel version (from /proc/version):

Linux version 2.6.19-rc3-pinguin20061024.1 (ingo@pinguin) (gcc version 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)) #1 SMP Tue Oct 24 16:47:01 CEST 2006


[5.] Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/oops-tracing.txt)

n/a, strace see above.


[6.] A small shell script or example program which triggers the
problem (if possible)

mkdir foo


[7.] Environment

[7.1.] Software (add the output of the ver_linux script here)

The nfs server is Debian testing, nfs-kernel-server version 1.0.10-2.

$ scripts/ver_linux
If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.

Linux pinguin 2.6.19-rc3-pinguin20061024.1 #1 SMP Tue Oct 24 16:47:01 CEST 2006 x86_64 GNU/Linux

Gnu C 4.1.2
Gnu make 3.81
binutils 2.17
util-linux 2.12r
mount 2.12r
module-init-tools 3.2.2
e2fsprogs 1.39
Linux C Library 2.3.6
Dynamic linker (ldd) 2.3.6
Procps 3.2.7
Net-tools 1.60
Console-tools 0.2.3
Sh-utils 5.97
udev 100
Modules Loaded nfs tun crc32 nfsd exportfs lockd sunrpc lp thermal fan button processor ac battery dm_snapshot dm_mirror dm_mod 8250_pnp snd_hda_intel snd_hda_codec snd_pcm_oss snd_mixer_oss sg snd_pcm i2c_i801 snd_timer iTCO_wdt 8250 serial_core i2c_core sr_mod intel_agp parport_pc parport e1000 cdrom floppy evdev snd soundcore snd_page_alloc psmouse rtc pcspkr unix


[7.2.] Processor information (from /proc/cpuinfo):

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz
stepping : 6
cpu MHz : 1862.002
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3726.93
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz
stepping : 6
cpu MHz : 1862.002
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3724.18
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:


[7.3.] Module information (from /proc/modules):
[7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
[7.5.] PCI information ('lspci -vvv' as root)
[7.6.] SCSI information (from /proc/scsi/scsi)

Please tell me if you think any of these are relevant.


[7.7.] Other information that might be relevant to the problem
(please look in /proc and include all information that you
think to be relevant):

The kernel is compiled for the x86_64 arch, the userspace and the nfs
kernel server code is still compiled for i386. The exported filesystems
are all ext3.

$ grep 'NFS\|RPC\|LOCKD' /boot/config-`uname -r`
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
CONFIG_NFS_V4=y
# CONFIG_NFS_DIRECTIO is not set
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
CONFIG_NFSD_V4=y
CONFIG_NFSD_TCP=y
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_RPCSEC_GSS_KRB5=m
CONFIG_RPCSEC_GSS_SPKM3=m
CONFIG_RXRPC=m


[X.] Other notes, patches, fixes, workarounds:

--
Man hat schon Igel nach Westen kotzen sehen!
(alte indianische Weisheit)


Attachments:
(No filename) (0.00 B)
(No filename) (373.00 B)
(No filename) (140.00 B)
Download all attachments

2006-11-08 23:01:01

by Ingo Saitz

[permalink] [raw]
Subject: Re: PROBLEM: can't mkdir() in 2.6.19-rc3 / 2.6.19-rc5

On Wed, Nov 01, 2006 at 03:16:47AM +0100, Ingo Saitz wrote:
> [1.] One line summary of the problem:
>
> Can't call mkdir() on 2.6.19-r3 nfsd

This is still present in 2.6.19-rc5 (-rc4 was completely broken, see
<[email protected]>), same host.

Ingo


Attachments:
(No filename) (0.00 B)
(No filename) (373.00 B)
(No filename) (140.00 B)
Download all attachments

2006-11-08 23:45:25

by J. Bruce Fields

[permalink] [raw]
Subject: Re: PROBLEM: can't mkdir() in 2.6.19-rc3

On Wed, Nov 01, 2006 at 03:16:47AM +0100, Ingo Saitz wrote:
> [2.] Full description of the problem/report:
>
> When I call "mkdir foo" on an nfs mounted volume, the strace of mkdir shows
>
> mkdir("foo", 0777) = -1 EPERM (Operation not permitted)
>
> and the command fails. But if I do a "ls -ld foo" afterwards, the directory got
> created:
>
> drwxr-xr-x 2 ingo ingo 4096 2006-11-01 02:54 foo
>
> The server is running 2.6.19-rc3, the client 2.6.18. The version of the
> nfs-kernel-server ist 1.0.10. This did work with 2.6.18 as nfs server.

Do you have the "async" option set on this export? (What does

exportfs -v

say?)

--b.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-11-09 00:49:22

by J. Bruce Fields

[permalink] [raw]
Subject: [PATCH] nfsd: fix spurious error return from nfsd_create in async case

Commit 6264d69d7df654ca64f625e9409189a0e50734e9 modified the
nfsd_create() error handling in such a way that nfsd_create will usually
return nfserr_perm even when succesful, if the export has the async
export option.

This introduced a regression that could cause mkdir() to always return a
permissions error, even though the directory in question was actually
succesfully created.

Signed-off-by: J. Bruce Fields <[email protected]>

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 1a7ad8c..bb4d926 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1177,7 +1177,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
/*
* Get the dir op function pointer.
*/
- err = nfserr_perm;
+ err = 0;
switch (type) {
case S_IFREG:
host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-11-09 01:29:36

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH] nfsd: fix spurious error return from nfsd_create in async case

On Wednesday November 8, [email protected] wrote:
> Commit 6264d69d7df654ca64f625e9409189a0e50734e9 modified the
> nfsd_create() error handling in such a way that nfsd_create will usually
> return nfserr_perm even when succesful, if the export has the async
> export option.
>
> This introduced a regression that could cause mkdir() to always return a
> permissions error, even though the directory in question was actually
> succesfully created.
>
> Signed-off-by: J. Bruce Fields <[email protected]>

Acked-by: NeilBrown <[email protected]>

Thanks Bruce. I checked the rest of that commit and I don't think the
same problem occurs anywhere else.

There is an 'err = nfserr_acces' in nfsd_lookup which is now dead
code... but I guess it already was before the patch.

That "err = " that you fixed was dead code before the patch, but
became a live problem.....

Thanks.
NeilBrown

>
> diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> index 1a7ad8c..bb4d926 100644
> --- a/fs/nfsd/vfs.c
> +++ b/fs/nfsd/vfs.c
> @@ -1177,7 +1177,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
> /*
> * Get the dir op function pointer.
> */
> - err = nfserr_perm;
> + err = 0;
> switch (type) {
> case S_IFREG:
> host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-11-09 01:35:35

by Ingo Saitz

[permalink] [raw]
Subject: Re: PROBLEM: can't mkdir() in 2.6.19-rc3

On Wed, Nov 08, 2006 at 06:45:15PM -0500, J. Bruce Fields wrote:
> Do you have the "async" option set on this export? (What does
>
> exportfs -v
>
> say?)

Yes, i do use async as optin. exportfs -v says:

/DATA/media 10.4.0.225(rw,async,wdelay,root_squash,anonuid=65534,anongid=65534)

Also, your patch in <[email protected]> fixes this
problem. Thanks.

Ingo

--
Man hat schon Igel nach Westen kotzen sehen!
(alte indianische Weisheit)


Attachments:
(No filename) (0.00 B)
(No filename) (373.00 B)
(No filename) (140.00 B)
Download all attachments

2006-11-09 02:52:48

by J. Bruce Fields

[permalink] [raw]
Subject: Re: PROBLEM: can't mkdir() in 2.6.19-rc3

On Thu, Nov 09, 2006 at 02:35:22AM +0100, Ingo Saitz wrote:
> On Wed, Nov 08, 2006 at 06:45:15PM -0500, J. Bruce Fields wrote:
> > Do you have the "async" option set on this export? (What does
> >
> > exportfs -v
> >
> > say?)
>
> Yes, i do use async as optin. exportfs -v says:
>
> /DATA/media 10.4.0.225(rw,async,wdelay,root_squash,anonuid=65534,anongid=65534)
>
> Also, your patch in <[email protected]> fixes this
> problem. Thanks.

Thanks for the confirmation.--b.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-11-09 02:53:56

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH] nfsd: fix spurious error return from nfsd_create in async case

On Thu, Nov 09, 2006 at 12:29:24PM +1100, Neil Brown wrote:
> Thanks Bruce. I checked the rest of that commit and I don't think the
> same problem occurs anywhere else.

Good, thanks, I didn't think to do that.

> There is an 'err = nfserr_acces' in nfsd_lookup which is now dead
> code... but I guess it already was before the patch.
>
> That "err = " that you fixed was dead code before the patch, but
> became a live problem.....

Yeah, that probably contributed to the confusion.

--b.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs