From: David Howells <dhowells@redhat.com>
To: viro@zeniv.linux.org.uk
Cc: dhowells@redhat.com, Dan Carpenter <dan.carpenter@oracle.com>,
linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
linux-kernel@vger.kernel.org
Subject: [PATCH] isofs: Fix isofs_show_options()
Date: Tue, 11 Jul 2017 16:22:59 +0100 [thread overview]
Message-ID: <21649.1499786579@warthog.procyon.org.uk> (raw)
In-Reply-To: <149926833041.20611.17777886366698384924.stgit@warthog.procyon.org.uk>
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)
next prev parent reply other threads:[~2017-07-11 15:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-05 15:24 [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() David Howells
2017-07-05 15:24 ` [PATCH 01/14] VFS: Don't use save/replace_mount_options if not using generic_show_options David Howells
2017-07-05 15:30 ` Steven Rostedt
2017-07-05 15:33 ` David Howells
2017-07-05 18:54 ` Steven Rostedt
2017-07-05 18:50 ` Greg Kroah-Hartman
2017-07-10 16:15 ` David Sterba
2017-07-05 15:24 ` [PATCH 02/14] hugetlbfs: Implement show_options David Howells
2017-07-05 15:24 ` [PATCH 03/14] omfs: " David Howells
2017-07-07 18:28 ` Bob Copeland
2017-07-05 15:24 ` [PATCH 04/14] pstore: " David Howells
2017-07-05 17:10 ` Kees Cook
2017-07-07 16:00 ` David Howells
2017-07-05 15:24 ` [PATCH 05/14] ramfs: " David Howells
2017-07-05 15:24 ` [PATCH 06/14] bpf: " David Howells
2017-07-06 8:00 ` Daniel Borkmann
2017-07-05 15:24 ` [PATCH 07/14] spufs: " David Howells
2017-07-05 15:25 ` [PATCH 08/14] befs: " David Howells
2017-07-05 15:25 ` [PATCH 09/14] affs: " David Howells
2017-07-05 15:25 ` [PATCH 10/14] afs: " David Howells
2017-07-05 15:25 ` [PATCH 11/14] isofs: " David Howells
2017-07-11 15:22 ` David Howells [this message]
2017-07-05 15:25 ` [PATCH 12/14] 9p: " David Howells
2017-07-11 22:34 ` Yury Norov
2017-07-11 23:34 ` David Howells
2017-07-05 15:25 ` [PATCH 13/14] orangefs: " David Howells
2017-07-05 15:25 ` [PATCH 14/14] VFS: Kill off s_options and helpers David Howells
2017-07-05 16:34 ` [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() Eric W. Biederman
2017-07-07 15:58 ` David Howells
2017-07-08 15:33 ` Theodore Ts'o
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=21649.1499786579@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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.