Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966130AbXEGSHl (ORCPT ); Mon, 7 May 2007 14:07:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S966115AbXEGSHl (ORCPT ); Mon, 7 May 2007 14:07:41 -0400 Received: from rk.rkuhn.info ([88.198.164.84]:46398 "EHLO mailhost.rkuhn.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966123AbXEGSHj (ORCPT ); Mon, 7 May 2007 14:07:39 -0400 In-Reply-To: <200705072151.20104.arvidjaar@mail.ru> References: <200705072151.20104.arvidjaar@mail.ru> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-83-538067608" Message-Id: <60F72760-C801-4F60-BF47-C661B4B5BE26@e18.physik.tu-muenchen.de> Cc: hirofumi@mail.parknet.co.jp, linux-kernel@vger.kernel.org From: Roland Kuhn Subject: Re: Long file names in VFAT broken with iocharset=utf8 Date: Mon, 7 May 2007 20:07:26 +0200 To: Andrey Borzenkov Content-Transfer-Encoding: 7bit X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.2) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9026 Lines: 176 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-83-538067608 Content-Type: multipart/signed; micalg=sha1; boundary=Apple-Mail-82-538067575; protocol="application/pkcs7-signature" --Apple-Mail-82-538067575 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hi Andrey! On 7 May 2007, at 19:51, Andrey Borzenkov wrote: > This was posted in one of Russian forums. It was not possible to > archive > (under Linux, using tar) vfat directory where files had long > Russian names > (really long - over 150 - 170 characters) - tar returned stat > failure. When > looking with plain ls, file names appeared truncated. > > Now looking at current (2.6.21) fat driver, __fat_readdir allocates > large > enough buffer (PAGE_SIZE-522) for UTF-8 name; but for > iocharset=utf8 it calls > uni16_to_x8() which artificially limits length of UTF-8 name to > 256 ... which > is obviously not enough for long UTF-8 Russian string (2 bytes per > character) > not to mention the - theoretical - general case of 6 bytes UTF-8 > characters. > > Similar problem has apparently vfat_lookup()->...->fat_search_long > () call > chain. Except this appears to be broken even in case of "utf8", > because > fat_search_long allocates fixed 256 bytes buffer for UTF-8 name. > > Am I off track here? > PATH_MAX specifically counts _bytes_ not characters, so UTF-8 does not matter. ISTR that PATH_MAX was 256 at some point, but I just quickly grepped /usr/include and found various mention of 4096, so where's the central repository for this configuration item? A hard- coded value of 256 somewhere inside the kernel smells like a bug. Ciao, Roland -- TU Muenchen, Physik-Department E18, James-Franck-Str., 85748 Garching Telefon 089/289-12575; Telefax 089/289-12570 -- CERN office: 892-1-D23 phone: +41 22 7676540 mobile: +41 76 487 4482 -- Any society that would give up a little liberty to gain a little security will deserve neither and lose both. - Benjamin Franklin -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GS/CS/M/MU d-(++) s:+ a-> C+++ UL++++ P+++ L+++ E(+) W+ !N K- w--- M + !V Y+ PGP++ t+(++) 5 R+ tv-- b+ DI++ e+++>++++ h---- y+++ ------END GEEK CODE BLOCK------ --Apple-Mail-82-538067575 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIINxTCCBi4w ggUWoAMCAQICCmEPqkwAAAAAAAMwDQYJKoZIhvcNAQEFBQAwQTESMBAGCgmSJomT8ixkARkWAmNo MRQwEgYKCZImiZPyLGQBGRYEY2VybjEVMBMGA1UEAxMMQ0VSTiBSb290IENBMB4XDTA2MTAwMzA5 MzYxM1oXDTE2MTAwMzA5NDYxM1owWTESMBAGCgmSJomT8ixkARkWAmNoMRQwEgYKCZImiZPyLGQB GRYEY2Vybj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nKxtDs0czOcvwhojbwGNSVCE7kNuaQyEglTqyX2QLXa+VRjmuqDmCISiqvCqXxUstY 1vPwt4UAQpKDVLmpwR/1F5n6ZCU1Wo46UPsN1b/rX8Ifl2182xYTRP4s6wAAAAAAAA== --Apple-Mail-82-538067575-- --Apple-Mail-83-538067608 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (Darwin) iD8DBQFGP2rjI4MWO8QIRP0RAuveAKCjzrWu8Eh2/VqFFan3UlEA1KJXJACaA+gL HjNjay0gx3rOaDK0ZeLE7lk= =xSHY -----END PGP SIGNATURE----- --Apple-Mail-83-538067608-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/