Date: Tue, 5 Apr 2011 15:35:49 +0100 From: Mark Blackman <mark@exonetric.com> To: Kostik Belousov <kostikbel@gmail.com> Cc: freebsd-fs@freebsd.org Subject: Re: Knob to turn off _POSIX_NO_TRUNC Message-ID: <7696AAE3-E04B-492F-9D96-3B526CFDFEE6@exonetric.com> In-Reply-To: <20110405141631.GA78089@deviant.kiev.zoral.com.ua> References: <20110405141631.GA78089@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On 5 Apr 2011, at 15:16, Kostik Belousov wrote: > From very old and gloomy SysV times I remembered filesystem behaviour > that silently truncated the file name components to the NAME_MAX limit, > that was, AFAIR, 14. To much of my dismay, I met some usermode software > recently that blindly tried to create the file from externally provided > name, and sometimes failed with ENAMETOOLONG in similar situation. > The authors are not cooperative. > > I ended up with the following hack, which almost turns off the > _POSIX_NO_TRUNC behaviour, globally on the system. Patch allowed me > to proceed. The cost in the default case is a single check, which is > performed only on ENAMETOOLONG path. If this is global, it might deal with a failing test when building Perl on a ZFS-only system which also tests this property. In particular, I believe ZFS neither truncates nor returns an error for any pathname length, so I'm not sure what the right test result should be. Building perl produces something like.. Only one test fails: ok 25 - calling pathconf("/tmp", _PC_NO_TRUNC) not ok 26 - checking that the returned value is defined (it isn't) or that errno is clear (it isn't, it's Invalid argument) # Failed test ' checking that the returned value is defined # (it isn't) or that errno is clear (it isn't, it's Invalid argument)' # at t/sysconf.t line 63. This thread.. http://lists.freebsd.org/pipermail/freebsd-fs/2010-November/010069.html talked about the NO_TRUNC behaviour in the context of ZFS. - Mark
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7696AAE3-E04B-492F-9D96-3B526CFDFEE6>