[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1524655799-12112-1-git-send-email-thunder.leizhen@huawei.com>
Date: Wed, 25 Apr 2018 19:29:59 +0800
From: Zhen Lei <thunder.leizhen@...wei.com>
To: Mark Fasheh <mark@...heh.com>, Joel Becker <jlbec@...lplan.org>,
ocfs2-devel <ocfs2-devel@....oracle.com>,
linux-kernel <linux-kernel@...r.kernel.org>
CC: Hanjun Guo <guohanjun@...wei.com>, Libin <huawei.libin@...wei.com>,
"Kefeng Wang" <wangkefeng.wang@...wei.com>,
Zhen Lei <thunder.leizhen@...wei.com>
Subject: [PATCH 1/1] ocfs2: eliminate a misreported warning
Below warning can not be happened, because the parameter chunksize passed
from ocfs2_info_freefrag_scan_chain-->ocfs2_info_update_ffg is guaranteed
to be positive. So __ilog2_u32 is impossible return -1.
fs/ocfs2/ioctl.c: In function 'ocfs2_info_update_ffg':
fs/ocfs2/ioctl.c:411:17: warning: array subscript is below array bounds [-Warray-bounds]
hist->fc_chunks[index]++;
^
fs/ocfs2/ioctl.c:411:17: warning: array subscript is below array bounds [-Warray-bounds]
Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
---
fs/ocfs2/ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index ab30c005..994726a 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -402,7 +402,7 @@ static int ocfs2_info_handle_freeinode(struct inode *inode,
static void o2ffg_update_histogram(struct ocfs2_info_free_chunk_list *hist,
unsigned int chunksize)
{
- int index;
+ u32 index;
index = __ilog2_u32(chunksize);
if (index >= OCFS2_INFO_MAX_HIST)
--
1.8.3
Powered by blists - more mailing lists