public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/fat: strip "cp" prefix from codepage in display
@ 2012-11-23 20:24 Dave Reisner
  2012-11-27 11:16 ` OGAWA Hirofumi
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Reisner @ 2012-11-23 20:24 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: linux-kernel, Dave Reisner

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>
---
 fs/fat/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 5bafaad..f037feb 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -725,7 +725,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);
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/fat: strip "cp" prefix from codepage in display
  2012-11-23 20:24 [PATCH] fs/fat: strip "cp" prefix from codepage in display Dave Reisner
@ 2012-11-27 11:16 ` OGAWA Hirofumi
  0 siblings, 0 replies; 2+ messages in thread
From: OGAWA Hirofumi @ 2012-11-27 11:16 UTC (permalink / raw)
  To: Dave Reisner; +Cc: linux-kernel

Dave Reisner <dreisner@archlinux.org> writes:

> 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.

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

But I think no guarantee, /proc/mounts can be used as mount command line.

> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> ---
>  fs/fat/inode.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 5bafaad..f037feb 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -725,7 +725,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);

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-27 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-23 20:24 [PATCH] fs/fat: strip "cp" prefix from codepage in display Dave Reisner
2012-11-27 11:16 ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox