summaryrefslogtreecommitdiffstats
path: root/fs/fat/namei_vfat.c
diff options
context:
space:
mode:
authorKevin Dankwardt <k@kcomputing.com>2010-02-10 23:43:40 +0900
committerOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2010-02-10 23:49:08 +0900
commiteeb5b4ae81f4a750355fa0c15f4fea22fdf83be1 (patch)
treed71cdc178b8643a5ddced54dc540403d11af9fa1 /fs/fat/namei_vfat.c
parent8045e2985012bdb95d832dfbcceae1815880a6ed (diff)
downloadop-kernel-dev-eeb5b4ae81f4a750355fa0c15f4fea22fdf83be1.zip
op-kernel-dev-eeb5b4ae81f4a750355fa0c15f4fea22fdf83be1.tar.gz
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index 411c192..c1ef501 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,
*outlen = utf8s_to_utf16s(name, len, (wchar_t *)outname);
if (*outlen < 0)
return *outlen;
- else if (*outlen > 255)
+ else if (*outlen > FAT_LFN_LEN)
return -ENAMETOOLONG;
op = &outname[*outlen * sizeof(wchar_t)];
} else {
if (nls) {
for (i = 0, ip = name, op = outname, *outlen = 0;
- i < len && *outlen <= 255;
+ i < len && *outlen <= FAT_LFN_LEN;
*outlen += 1)
{
if (escape && (*ip == ':')) {
@@ -549,7 +549,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname,
return -ENAMETOOLONG;
} else {
for (i = 0, ip = name, op = outname, *outlen = 0;
- i < len && *outlen <= 255;
+ i < len && *outlen <= FAT_LFN_LEN;
i++, *outlen += 1)
{
*op++ = *ip++;
OpenPOWER on IntegriCloud