diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-12-17 16:03:01 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 17:15:22 -0800 |
commit | c6c20372bbb2f70d2757eed0a8d6860884bae11f (patch) | |
tree | 62ce9835296c45696abb9ab50a9e12c0b84cfbbd | |
parent | 5b3d5aeaa333850756f41350fed2fc95912b2a4f (diff) | |
download | linux-c6c20372bbb2f70d2757eed0a8d6860884bae11f.tar.gz linux-c6c20372bbb2f70d2757eed0a8d6860884bae11f.tar.bz2 linux-c6c20372bbb2f70d2757eed0a8d6860884bae11f.zip |
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
reuse.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/fat/inode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 3b733a730952..35806813ea4e 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); |