Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933420AbdGKPXK convert rfc822-to-8bit (ORCPT ); Tue, 11 Jul 2017 11:23:10 -0400 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 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0CE6C74864 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dhowells@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0CE6C74864 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 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> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 11 Jul 2017 15:23:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1341 Lines: 35 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)