Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6c20372 authored by Dave Reisner's avatar Dave Reisner Committed by Linus Torvalds
Browse files

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: default avatarDave Reisner <dreisner@archlinux.org>
Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5b3d5aea
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -726,7 +726,8 @@ static int fat_show_options(struct seq_file *m, struct dentry *root)
	if (opts->allow_utime)
	if (opts->allow_utime)
		seq_printf(m, ",allow_utime=%04o", opts->allow_utime);
		seq_printf(m, ",allow_utime=%04o", opts->allow_utime);
	if (sbi->nls_disk)
	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 (isvfat) {
		if (sbi->nls_io)
		if (sbi->nls_io)
			seq_printf(m, ",iocharset=%s", sbi->nls_io->charset);
			seq_printf(m, ",iocharset=%s", sbi->nls_io->charset);