Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:51061 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932229AbdGKPXI (ORCPT ); Tue, 11 Jul 2017 11:23:08 -0400 From: David Howells In-Reply-To: <149926833041.20611.17777886366698384924.stgit@warthog.procyon.org.uk> References: <149926833041.20611.17777886366698384924.stgit@warthog.procyon.org.uk> <149926824154.20611.6104595541055328700.stgit@warthog.procyon.org.uk> To: viro@zeniv.linux.org.uk Cc: dhowells@redhat.com, Dan Carpenter , linux-fsdevel@vger.kernel.org, Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH] isofs: Fix isofs_show_options() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21648.1499786579.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Tue, 11 Jul 2017 16:22:59 +0100 Message-ID: <21649.1499786579@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 Signed-off-by: David Howells --- 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)