All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Dave Reisner <dreisner@archlinux.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/fat: strip "cp" prefix from codepage in display
Date: Tue, 27 Nov 2012 20:16:01 +0900	[thread overview]
Message-ID: <871ufffg9a.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1353702268-1568-1-git-send-email-dreisner@archlinux.org> (Dave Reisner's message of "Fri, 23 Nov 2012 15:24:28 -0500")

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>

      reply	other threads:[~2012-11-27 11:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ufffg9a.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=dreisner@archlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.