linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autofs4 symlink size
@ 2001-10-24 15:20 linux
  2001-10-24 20:24 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: linux @ 2001-10-24 15:20 UTC (permalink / raw)
  To: linux-kernel

I sent this to the autofs4 maintainer a while ago, but never heard back.
autofs4 doesn't return a size for the symlinks it creates, which is
inconsistent with other filesystems.  (The Almquist shell uses the sizes
of path components to allocate buffers during a walk, so it can't traverse
autofs4-linked paths.)

This patch applies against 2.4.9 (and probably earlier) through 2.4.13.

--- fs/autofs4/inode.c.orig	Fri Feb  9 14:29:44 2001
+++ fs/autofs4/inode.c	Thu Aug 23 16:01:59 2001
@@ -315,8 +315,10 @@
 		inode->i_nlink = 2;
 		inode->i_op = &autofs4_dir_inode_operations;
 		inode->i_fop = &autofs4_dir_operations;
-	} else if (S_ISLNK(inf->mode))
+	} else if (S_ISLNK(inf->mode)) {
+		inode->i_size = inf->size;
 		inode->i_op = &autofs4_symlink_inode_operations;
+	}
 
 	return inode;
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] autofs4 symlink size
  2001-10-24 15:20 [PATCH] autofs4 symlink size linux
@ 2001-10-24 20:24 ` H. Peter Anvin
  2001-10-24 21:00   ` linux
  0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2001-10-24 20:24 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <20011024102050.A12112@sigint.cs.purdue.edu>
By author:    linux@sigint.cs.purdue.edu
In newsgroup: linux.dev.kernel
>
> I sent this to the autofs4 maintainer a while ago, but never heard back.
> autofs4 doesn't return a size for the symlinks it creates, which is
> inconsistent with other filesystems.  (The Almquist shell uses the sizes
> of path components to allocate buffers during a walk, so it can't traverse
> autofs4-linked paths.)
> 

That's IMNSHO a bug in the Almquist shell, at least if autofs4 returns
zero, but it's also a bug in autofs4.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] autofs4 symlink size
  2001-10-24 20:24 ` H. Peter Anvin
@ 2001-10-24 21:00   ` linux
  0 siblings, 0 replies; 3+ messages in thread
From: linux @ 2001-10-24 21:00 UTC (permalink / raw)
  To: linux-kernel

On Wed, Oct 24, 2001 at 01:24:10PM -0700, H. Peter Anvin wrote:
> >
> > I sent this to the autofs4 maintainer a while ago, but never heard back.
> > autofs4 doesn't return a size for the symlinks it creates, which is
> > inconsistent with other filesystems.  (The Almquist shell uses the sizes
> > of path components to allocate buffers during a walk, so it can't traverse
> > autofs4-linked paths.)
> 
> That's IMNSHO a bug in the Almquist shell, at least if autofs4 returns
> zero, but it's also a bug in autofs4.

True, ash could do things differently, but I don't think expecting the
filesystem to return correct metadata is a bug.  Should we distrust stat(2)
and count the bytes in a file ourselves, just to be sure?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-24 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-24 15:20 [PATCH] autofs4 symlink size linux
2001-10-24 20:24 ` H. Peter Anvin
2001-10-24 21:00   ` linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).