Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1253762pxa; Thu, 20 Aug 2020 06:51:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFaOKsJ//xyMp96V1rN+Wr3l8985mgHLqQr34Ou+nueO3VcxwprZpvNy7KkPtlLksa8hNu X-Received: by 2002:a50:f687:: with SMTP id d7mr3014109edn.306.1597931497408; Thu, 20 Aug 2020 06:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931497; cv=none; d=google.com; s=arc-20160816; b=moA2CHplIFdhAMI4J0uw/iA+Cwl3SHQd9MoSXEhWSrskeLgyQVaPLxi64U4+F6aIPn mMbK4PSnE0m6cT6RIcqoQ+HDe+A43TNVDU9DJqV3nfeWCWYg6qSxpgoefw1NphTc41IF t8YU/3KB5avMrRHPJqLXWjZEJLgH+wuEVih3vCBOZlyuxSAjEL6mXzZmpJx4PNg/VQhP sn+Z0X85/QCRW2mB32KjaAHs6jP7vfTW/OkEZr1J+WhqM9pU1EUR+a1QbTuE1W5BdPPy xGp3Qi5r0y5Zrc4D4+wtAQ/vFAWNlN3+sp2gw3qKNPDHeRzxSNCscGY3fOQ8M2RYpnhN FDlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yiSZ2MnD01zCI/Mr/GUuB5LNoCrzXAcMIYFU2ytITdA=; b=JCNnYd+zEtbUYaoKyAiDzPCoB9Ti/7woT35nwePsJEKkobSzcRPKdZl/GQoM93bf08 daLkxswSzOnA52O1MRle2i/KGMxhmzKNe1UTnc8LAeFy9E4mIQ5PbqtMjEtYRnAY2CHd yGy5bSIzEBpWxrICK8JY2s30GBdAHbOs0bStbtpmLsdE+8ZGwukc7y6CRdQfwkKwUEaT DRrbHvgrAt3nwkWIHY2k/mtBi5ZhGb8MGOCaFJLXTYSk69XBKRnRl0t66SU0wsn2GDD0 iWGIgpRl3hJWhOvc5VRvEnFs6KWUEMPROjgiP24+7ejPzwk4oB8aaTGwAMfDRof0lZHV I+eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZAWvR2Hs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si1357862ejb.68.2020.08.20.06.51.12; Thu, 20 Aug 2020 06:51:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZAWvR2Hs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729601AbgHTNuF (ORCPT + 99 others); Thu, 20 Aug 2020 09:50:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:36868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727956AbgHTJ1W (ORCPT ); Thu, 20 Aug 2020 05:27:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B3B6B2224D; Thu, 20 Aug 2020 09:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915641; bh=9xm3/+RTBPQYWS6XNn5NPWhUPDrqLdrKs6vsvXi7Yhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAWvR2HsLjuSL1UiOa4DFGwhMLyHsKj72hBNO4DqlFfh+P5dq0d40H+FXqTkvQKIe u4yJdhPfrLjZmND5oCEaNL9iMrCijKDfEv7ENyvcyl/ILJTycQVkjPL0RJ75zv0BTq Cy3I2B94z1MdsOxSlXXWSKnSiwO+Se2dORIKqtKI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Junxiao Bi , Andrew Morton , Joseph Qi , Gang He , Mark Fasheh , Joel Becker , Changwei Ge , Jun Piao , Linus Torvalds Subject: [PATCH 5.8 084/232] ocfs2: change slot number type s16 to u16 Date: Thu, 20 Aug 2020 11:18:55 +0200 Message-Id: <20200820091616.885142054@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Junxiao Bi commit 38d51b2dd171ad973afc1f5faab825ed05a2d5e9 upstream. Dan Carpenter reported the following static checker warning. fs/ocfs2/super.c:1269 ocfs2_parse_options() warn: '(-1)' 65535 can't fit into 32767 'mopt->slot' fs/ocfs2/suballoc.c:859 ocfs2_init_inode_steal_slot() warn: '(-1)' 65535 can't fit into 32767 'osb->s_inode_steal_slot' fs/ocfs2/suballoc.c:867 ocfs2_init_meta_steal_slot() warn: '(-1)' 65535 can't fit into 32767 'osb->s_meta_steal_slot' That's because OCFS2_INVALID_SLOT is (u16)-1. Slot number in ocfs2 can be never negative, so change s16 to u16. Fixes: 9277f8334ffc ("ocfs2: fix value of OCFS2_INVALID_SLOT") Reported-by: Dan Carpenter Signed-off-by: Junxiao Bi Signed-off-by: Andrew Morton Reviewed-by: Joseph Qi Reviewed-by: Gang He Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Cc: Link: http://lkml.kernel.org/r/20200627001259.19757-1-junxiao.bi@oracle.com Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/ocfs2.h | 4 ++-- fs/ocfs2/suballoc.c | 4 ++-- fs/ocfs2/super.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -327,8 +327,8 @@ struct ocfs2_super spinlock_t osb_lock; u32 s_next_generation; unsigned long osb_flags; - s16 s_inode_steal_slot; - s16 s_meta_steal_slot; + u16 s_inode_steal_slot; + u16 s_meta_steal_slot; atomic_t s_num_inodes_stolen; atomic_t s_num_meta_stolen; --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -879,9 +879,9 @@ static void __ocfs2_set_steal_slot(struc { spin_lock(&osb->osb_lock); if (type == INODE_ALLOC_SYSTEM_INODE) - osb->s_inode_steal_slot = slot; + osb->s_inode_steal_slot = (u16)slot; else if (type == EXTENT_ALLOC_SYSTEM_INODE) - osb->s_meta_steal_slot = slot; + osb->s_meta_steal_slot = (u16)slot; spin_unlock(&osb->osb_lock); } --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -78,7 +78,7 @@ struct mount_options unsigned long commit_interval; unsigned long mount_opt; unsigned int atime_quantum; - signed short slot; + unsigned short slot; int localalloc_opt; unsigned int resv_level; int dir_resv_level; @@ -1349,7 +1349,7 @@ static int ocfs2_parse_options(struct su goto bail; } if (option) - mopt->slot = (s16)option; + mopt->slot = (u16)option; break; case Opt_commit: if (match_int(&args[0], &option)) {