From f68e542f3478147986a9c8958942ec649dc06201 Mon Sep 17 00:00:00 2001 From: OGAWA Hirofumi Date: Tue, 12 Apr 2011 21:08:39 +0900 Subject: fat: Fix statfs->f_namelen pathconf(, _PC_NAME_MAX) is too small for long Unicode filename on fat. 255 as max filename size on fat is Unicode UTF-16 characters. it's not byte size. https://bugzilla.kernel.org/show_bug.cgi?id=16469 To fix it, this returns "len * NLS_MAX_CHARSET_SIZE" instead. Reported-by: Takumi Asaki Signed-off-by: OGAWA Hirofumi --- fs/fat/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/fat') diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 7a6c819893f2..cb8d8391ac0b 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -581,7 +581,8 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = sbi->free_clusters; buf->f_fsid.val[0] = (u32)id; buf->f_fsid.val[1] = (u32)(id >> 32); - buf->f_namelen = sbi->options.isvfat ? FAT_LFN_LEN : 12; + buf->f_namelen = + (sbi->options.isvfat ? FAT_LFN_LEN : 12) * NLS_MAX_CHARSET_SIZE; return 0; } -- cgit v1.2.3