Re: NFS & long symlinks = stack overflow

From: viro
Date: Sat May 15 2004 - 08:54:24 EST

On Sat, May 15, 2004 at 04:21:49PM +0300, Oleg Drokin wrote:
> Hello!
> For some time already I am investigating problems where fsstress run on
> NFS where NFSD is run on ext3 crashes in something like a hour.
> (but does not crash on reiserfs). On x86 crash looks like stack overflow
> (deref of pointer with last 3 digits being zero in kmap directly after
> get_current() call on 2.4.2x).
> Finally I was able to reduce a test case to two simple operations
> that reproduce the problem 100% reliably:
> [root@ranma root]# mount ranma:/testing /mnt -t nfs
> [root@ranma root]# cd /mnt
> [root@ranma mnt]# perl -e 'symlink("a"x4095, "f")'; ls -la f
> Segmentation fault
> (btw if you try to pass in something like 4090 worth of symbols, then
> subsequent ls won't crash, but last few symbols of link content will be
> corrupted)

Lovely. The real limit imposed by client (apparently not enforced, though)
is PAGE_CACHE_SIZE - 4 - 1. What are the protocol limits? I've been looking
into the same area for other reasons just now and all I could find was NFS v2
"no more than 1024 bytes", no information on v3 or v4.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at