Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685136

[PATCH] isofs: Fix isofs_show_options()

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH] isofs: Fix isofs_show_options()
Date 2017-07-11 17:30 +0200
Message-ID <u25gS-41E-7@gated-at.bofh.it> (permalink)
References <tZUpA-83i-31@gated-at.bofh.it> <tZUpz-83i-3@gated-at.bofh.it> <tZUpA-83i-31@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


Hi Al,

The isofs patch needs a small fix to handle a signed/unsigned comparison that
the compiler didn't flag - thanks to Dan for catching it.

It should be noted, however, as mentioned in a previous email, the session
number handing appears to be incorrect between where it is parsed and where it
is used.

David
---
isofs: Fix isofs_show_options()

isofs_show_options() compares sbi->s_session to -1, but s_session is an
unsigned char, so the comparison isn't right.  Compare against 255 instead.

Further, 1 needs subtracting from the session number to counteract the
increment in the option parser.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index f80ee600d1bc..add72c995f90 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -492,7 +492,7 @@ static int isofs_show_options(struct seq_file *m, struct dentry *root)
 
 	if (sbi->s_check)		seq_printf(m, ",check=%c", sbi->s_check);
 	if (sbi->s_mapping)		seq_printf(m, ",map=%c", sbi->s_mapping);
-	if (sbi->s_session != -1)	seq_printf(m, ",session=%u", sbi->s_session);
+	if (sbi->s_session != 255)	seq_printf(m, ",session=%u", sbi->s_session - 1);
 	if (sbi->s_sbsector != -1)	seq_printf(m, ",sbsector=%u", sbi->s_sbsector);
 
 	if (root->d_sb->s_blocksize != 1024)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 00/14] VFS: Make all filesystems implement  ->show_options() David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
  [PATCH 11/14] isofs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
    [PATCH] isofs: Fix isofs_show_options() David Howells <dhowells@redhat.com> - 2017-07-11 17:30 +0200
  [PATCH 04/14] pstore: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
    Re: [PATCH 04/14] pstore: Implement show_options Kees Cook <keescook@chromium.org> - 2017-07-05 19:20 +0200
      Re: [PATCH 04/14] pstore: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-07 18:10 +0200
  [PATCH 07/14] spufs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
  [PATCH 10/14] afs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
  [PATCH 08/14] befs: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
  [PATCH 06/14] bpf: Implement show_options David Howells <dhowells@redhat.com> - 2017-07-05 17:30 +0200
    Re: [PATCH 06/14] bpf: Implement show_options Daniel Borkmann <daniel@iogearbox.net> - 2017-07-06 10:10 +0200
  Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() ebiederm@xmission.com (Eric W. Biederman) - 2017-07-05 18:50 +0200
    Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() David Howells <dhowells@redhat.com> - 2017-07-07 18:00 +0200
      Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement  ->show_options() Theodore Ts'o <tytso@mit.edu> - 2017-07-08 17:40 +0200

csiph-web