Commit c6c20372bbb2f70d2757eed0a8d6860884bae11f
Committed by
Linus Torvalds
1 parent
5b3d5aeaa3
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>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
fs/fat/inode.c
... | ... | @@ -726,7 +726,8 @@ |
726 | 726 | if (opts->allow_utime) |
727 | 727 | seq_printf(m, ",allow_utime=%04o", opts->allow_utime); |
728 | 728 | if (sbi->nls_disk) |
729 | - seq_printf(m, ",codepage=%s", sbi->nls_disk->charset); | |
729 | + /* strip "cp" prefix from displayed option */ | |
730 | + seq_printf(m, ",codepage=%s", &sbi->nls_disk->charset[2]); | |
730 | 731 | if (isvfat) { |
731 | 732 | if (sbi->nls_io) |
732 | 733 | seq_printf(m, ",iocharset=%s", sbi->nls_io->charset); |