diff options
author | Kevin Dankwardt <k@kcomputing.com> | 2010-02-10 09:43:40 -0500 |
---|---|---|
committer | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2010-02-10 09:49:08 -0500 |
commit | eeb5b4ae81f4a750355fa0c15f4fea22fdf83be1 (patch) | |
tree | d71cdc178b8643a5ddced54dc540403d11af9fa1 /fs/fat/namei_vfat.c | |
parent | 8045e2985012bdb95d832dfbcceae1815880a6ed (diff) |
fat: Fix stat->f_namelen
I found that the length of a file name when created cannot exceed 255
characters, yet, pathconf(), via statfs(), returns the maximum as 260.
Signed-off-by: Kevin Dankwardt <k@kcomputing.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Diffstat (limited to 'fs/fat/namei_vfat.c')
-rw-r--r-- | fs/fat/namei_vfat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index 411c192a05fa..c1ef50154868 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c | |||
@@ -502,14 +502,14 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, | |||
502 | *outlen = utf8s_to_utf16s(name, len, (wchar_t *)outname); | 502 | *outlen = utf8s_to_utf16s(name, len, (wchar_t *)outname); |
503 | if (*outlen < 0) | 503 | if (*outlen < 0) |
504 | return *outlen; | 504 | return *outlen; |
505 | else if (*outlen > 255) | 505 | else if (*outlen > FAT_LFN_LEN) |
506 | return -ENAMETOOLONG; | 506 | return -ENAMETOOLONG; |
507 | 507 | ||
508 | op = &outname[*outlen * sizeof(wchar_t)]; | 508 | op = &outname[*outlen * sizeof(wchar_t)]; |
509 | } else { | 509 | } else { |
510 | if (nls) { | 510 | if (nls) { |
511 | for (i = 0, ip = name, op = outname, *outlen = 0; | 511 | for (i = 0, ip = name, op = outname, *outlen = 0; |
512 | i < len && *outlen <= 255; | 512 | i < len && *outlen <= FAT_LFN_LEN; |
513 | *outlen += 1) | 513 | *outlen += 1) |
514 | { | 514 | { |
515 | if (escape && (*ip == ':')) { | 515 | if (escape && (*ip == ':')) { |
@@ -549,7 +549,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, | |||
549 | return -ENAMETOOLONG; | 549 | return -ENAMETOOLONG; |
550 | } else { | 550 | } else { |
551 | for (i = 0, ip = name, op = outname, *outlen = 0; | 551 | for (i = 0, ip = name, op = outname, *outlen = 0; |
552 | i < len && *outlen <= 255; | 552 | i < len && *outlen <= FAT_LFN_LEN; |
553 | i++, *outlen += 1) | 553 | i++, *outlen += 1) |
554 | { | 554 | { |
555 | *op++ = *ip++; | 555 | *op++ = *ip++; |