Re: quick question about filename length

Martin Steigerwald
2009-05-16T21:41:11Z

Am Samstag 16 Mai 2009 schrieb Christoph Hellwig:
> On Sat, May 16, 2009 at 02:06:22PM -0400, Chris Walker wrote:
> > Thanks for you quick reply, Eric.
> >
> > I have a user who is having filenames (path+filename) cut off at 255
> > characters midway through a simulation -- but the problem must be
> > elsewhere
>
> XFS doesn't actually see the whole filename in normal operation (except
> for copying out the data out of symbolic links), as the resolution to
> individual components is done by the VFS. Long file name should work
> just fine on Linux and do in my test. Maybe some buffer is sized using
> incorrect in userspace?

And while a link name itself also can't be longer than about 256
characters (I only tested 250 and 260), a link can point to a longer
path ;-):

martin@shambhala:~/Zeit> mkdir -p
$(ruby -e 'puts "1234567890"*25')/$(ruby -e 'puts "1234567890"*25')
martin@shambhala:~/Zeit> ln -s
$(ruby -e 'puts "1234567890"*25')/$(ruby -e 'puts "1234567890"*25')
testlink
martin@shambhala:~/Zeit> ls -l testlink
lrwxrwxrwx 1 martin martin 501 16. Mai 23:40 testlink ->
12345678901234567890123456789012345678901234567890123456789[...]
martin@shambhala:~/Zeit> (df -hT . | grep -q xfs) && echo "Is XFS"
Is XFS

--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7