linux-pf / fat-3.6.x.patch

The default branch has multiple heads

From: Dave Reisner <>
Date: Thu, 29 Nov 2012 03:18:52 +0000 (+1100)
Subject: fs/fat: strip "cp" prefix from codepage in display
X-Git-Tag: next-20121130~1^2~97

fs/fat: strip "cp" prefix from codepage in display

Option parsing code expects an unsigned integer for the codepage option,
but prefixes and stores this option with "cp" before passing to
load_nls().  This makes the displayed option in /proc an invalid one.
Strip the prefix when printing so that the displayed option is valid for

Signed-off-by: Dave Reisner <>
Acked-by: OGAWA Hirofumi <>
Signed-off-by: Andrew Morton <>

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 3b733a7..3580681 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -726,7 +726,8 @@ static int fat_show_options(struct seq_file *m, struct dentry *root)
	if (opts->allow_utime)
		seq_printf(m, ",allow_utime=%04o", opts->allow_utime);
	if (sbi->nls_disk)
-		seq_printf(m, ",codepage=%s", sbi->nls_disk->charset);
+		/* strip "cp" prefix from displayed option */
+		seq_printf(m, ",codepage=%s", &sbi->nls_disk->charset[2]);
	if (isvfat) {
		if (sbi->nls_io)
			seq_printf(m, ",iocharset=%s", sbi->nls_io->charset);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.