Re: 2.6.19: OOPS in cat /proc/fs/nfs/exports

2006-12-19 Thread Olaf Titz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> > I've replaced exportfs, mountd and nfsd with a newer version and it
> > works now.
>
> What version were you using?  I would really like to know.

The system in question was built on a Knoppix release based on Debian
Potato, with updates from Woody. Most likely this is the package
nfs-kernel-server 1.0-2woody3 based on nfs-utils 1.0, which is the oldest
version still to be found on the Debian mirrors.

(argh, I should have saved the old binaries and [more important, since
the binaries have no version indication] package docs...)

Olaf
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFFiFgxGPw4gdAdiZ0RAvXjAJ0X+BPu8cUg+IHEZRG51KWFKevFTwCfSGCr
j+fcUcfnunp1dyCDCrBlUBU=
=9Uqx
-END PGP SIGNATURE-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.19: OOPS in cat /proc/fs/nfs/exports

2006-12-06 Thread Neil Brown
On Tuesday December 5, [EMAIL PROTECTED] wrote:
> 
> strace on exportfs shows this:nfsservctl(0x3, 0xbf875824, 0)  =
> - -1 ENOMEM

What version of nfs-utils are you running?  We haven't been using
nfsservctl(3, ...) on 2.6 kernels for ages - which probably explains
why exp_export() has suffered so much bit-rot.  When I convinced
exportfs to use that nfsservctl I got a very similar oops.


This patch fixes it for me.  Does it fix it for you too?

Thanks,
NeilBrown



diff .prev/fs/nfsd/export.c ./fs/nfsd/export.c
--- .prev/fs/nfsd/export.c  2006-12-06 14:57:24.0 +1100
+++ ./fs/nfsd/export.c  2006-12-07 12:36:28.0 +1100
@@ -983,6 +983,9 @@ exp_export(struct nfsctl_export *nxp)
 
dprintk("nfsd: creating export entry %p for client %p\n", exp, clp);
 
+   new.ex_path = kstrdup(nxp->ex_path, GFP_KERNEL);
+   if (!new.ex_path)
+   goto finish;
new.h.expiry_time = NEVER;
new.h.flags = 0;
new.ex_client = clp;
@@ -992,6 +995,9 @@ exp_export(struct nfsctl_export *nxp)
new.ex_anon_uid = nxp->ex_anon_uid;
new.ex_anon_gid = nxp->ex_anon_gid;
new.ex_fsid = nxp->ex_dev;
+   new.ex_fslocs.locations = NULL;
+   new.ex_fslocs.locations_count = 0;
+   new.ex_fslocs.migrated = 0;
 
exp = svc_export_lookup(&new);
if (exp)
@@ -1007,8 +1013,10 @@ exp_export(struct nfsctl_export *nxp)
cache_flush();
err = -ENOMEM;
}
-
+   err = 0;
 finish:
+   if (new.ex_path)
+   kfree(new.ex_path);
if (exp)
exp_put(exp);
if (fsid_key && !IS_ERR(fsid_key))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.19: OOPS in cat /proc/fs/nfs/exports

2006-12-06 Thread Olaf Titz
> Will try your patch tomorrow.

...which does not change anything. (As expected.)

Olaf
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.19: OOPS in cat /proc/fs/nfs/exports

2006-12-05 Thread Olaf Titz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> There is a place where a failed kstrdup could lead to this, but that
> is rather unlikely and wouldn't be as reproducible as this seems to
> be.
> If you boot up and then immediately shutdown does this error trigger,
> it does it have to be up for a while?

It happens right after booting.

I've since disabled the NFS server on that box, and just tried to
manually start it, and it gives me this:
# /usr/sbin/exportfs -r
bigred:/video/rec: Cannot allocate memory

That is the first and only export:

# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be
exported
#   to NFS clients.  See exports(5).

/video/rec  bigred(rw,sync)

strace on exportfs shows this:nfsservctl(0x3, 0xbf875824, 0)  =
- -1 ENOMEM

After that, /proc/fs/nfs/export exists and gives the Oops, while
/proc/fs/nfsd/export doesn't exist.

I don't think however this box is particularly short on memory:

MemTotal:   248704 kB
MemFree:102780 kB
Buffers: 20520 kB
Cached:  50692 kB
SwapCached:  0 kB
Active:  81712 kB
Inactive:25160 kB
SwapTotal:   0 kB
SwapFree:0 kB
Dirty:1516 kB
Writeback:   0 kB
AnonPages:   35672 kB
Mapped:  13104 kB
Slab: 6960 kB
SReclaimable: 3104 kB
SUnreclaim:   3856 kB
PageTables:692 kB
NFS_Unstable:0 kB
Bounce:  0 kB
CommitLimit:124352 kB
Committed_AS:   124528 kB
VmallocTotal:   786136 kB
VmallocUsed:  7568 kB
VmallocChunk:   778508 kB

(this is right after booting, DVB drivers loaded and VDR running.)

Will try your patch tomorrow.

Olaf

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFdfNoGPw4gdAdiZ0RAjDdAJ4yPltxWuJe21yB9nc2zBooLWJ2TwCaAg1I
tNsnDshD1gVpW/FYJ5P9J28=
=1zag
-END PGP SIGNATURE-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.19: OOPS in cat /proc/fs/nfs/exports

2006-12-04 Thread Neil Brown
On Monday December 4, [EMAIL PROTECTED] wrote:
> This is 100% reproducible. It hangs exportfs on shutdown.
> 
> Dec  4 19:50:13 glotze kernel: BUG: unable to handle kernel NULL pointer 
> dereference at virtual address 0040
> Dec  4 19:50:13 glotze kernel:  printing eip:
> Dec  4 19:50:13 glotze kernel: c017254a
> Dec  4 19:50:13 glotze kernel: *pde = 
> Dec  4 19:50:13 glotze kernel: Oops:  [#1]
> Dec  4 19:50:13 glotze kernel: PREEMPT 
> Dec  4 19:50:13 glotze kernel: Modules linked in: nfsd exportfs i915 stv0299 
> budget_ci budget_core dvb_core saa7146 ttpci_eeprom 8250 serial_core nfs 
> lockd sunrpc tuner tvaudio bttv video_buf ir_common compat_ioctl32 
> i2c_algo_bit btcx_risc tveeprom i2c_core videodev v4l1_compat v4l2_common 
> ipv6 nvram snd_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm snd_timer snd 
> soundcore snd_page_alloc ide_cd cdrom e100 mii af_packet
> Dec  4 19:50:13 glotze kernel: CPU:0
> Dec  4 19:50:13 glotze kernel: EIP:0060:[seq_escape+29/201]Not 
> tainted VLI
> Dec  4 19:50:13 glotze kernel: EFLAGS: 00010286   (2.6.19 #2)
> Dec  4 19:50:13 glotze kernel: EIP is at seq_escape+0x1d/0xc9
> Dec  4 19:50:13 glotze kernel: eax: c761   ebx: c7370e00   ecx: 1000  
>  edx: c761005c
> Dec  4 19:50:13 glotze kernel: esi: 0040   edi: d0590384   ebp: cd2115f4  
>  esp: c9543ef4
> Dec  4 19:50:13 glotze kernel: ds: 007b   es: 007b   ss: 0068
> Dec  4 19:50:13 glotze kernel: Process cat (pid: 1379, ti=c9542000 
> task=c73ea030 task.ti=c9542000)
> Dec  4 19:50:13 glotze kernel: Stack: c7370e00 c017219d 0004 c7370e00 
> 0810 cd2115f4 d05878e7 c7370e00 
> Dec  4 19:50:13 glotze kernel:d059037e d0590343 d059036f fffe 
> fffe 0004 0301 d05969d0 
> Dec  4 19:50:13 glotze kernel:c7370e00 cd2115c0 0029 c01727c3 
> 0400 0804c848 cb9cb740 c7370e20 
> Dec  4 19:50:13 glotze kernel: Call Trace:
> Dec  4 19:50:13 glotze kernel:  [seq_printf+46/82] seq_printf+0x2e/0x52
> Dec  4 19:50:13 glotze kernel:  [pg0+270379239/1069880320] 
> svc_export_show+0x1dd/0x2b1 [nfsd]

That shouldn't happen (of course).

There is a place where a failed kstrdup could lead to this, but that
is rather unlikely and wouldn't be as reproducible as this seems to
be.
If you boot up and then immediately shutdown does this error trigger,
it does it have to be up for a while?

Just before shutting down, can you

   cat /proc/fs/nfsd/exports

and see if that works?  If so, can you show me the contents.
If not, can I see your /etc/exports ??

Thanks,

NeilBrown


This patch fixes a problem that is very unlikely to be yours.

Signed-off-by: Neil Brown <[EMAIL PROTECTED]>

### Diffstat output
 ./net/sunrpc/svcauth_unix.c |4 
 1 file changed, 4 insertions(+)

diff .prev/net/sunrpc/svcauth_unix.c ./net/sunrpc/svcauth_unix.c
--- .prev/net/sunrpc/svcauth_unix.c 2006-12-05 15:20:26.0 +1100
+++ ./net/sunrpc/svcauth_unix.c 2006-12-05 15:20:48.0 +1100
@@ -53,6 +53,10 @@ struct auth_domain *unix_domain_find(cha
return NULL;
kref_init(&new->h.ref);
new->h.name = kstrdup(name, GFP_KERNEL);
+   if (new->h.name == NULL) {
+   kree(new);
+   return NULL;
+   }
new->h.flavour = &svcauth_unix;
new->addr_changes = 0;
rv = auth_domain_lookup(name, &new->h);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/