[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230116134755.40119-1-frank.li@vivo.com>
Date: Mon, 16 Jan 2023 21:47:55 +0800
From: Yangtao Li <frank.li@...o.com>
To: jaegeuk@...nel.org, chao@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: Re: [f2fs-dev] [PATCH v2 1/2] f2fs: fix to avoid potential memory corruption in __update_iostat_latency()
Hi Chao,
> Maybe it's betterr to merge these two check condition as below?
>
> if (iotype >= NR_PAGE_TYPE) {
> f2fs_bug_on(sbi, iotype != META_FLUSH);
> iotype = META;
> }
For normal , only META_FLUSH will be greater than NR_PAGE_TYPE,
there is no problem with this logic.
>
> For CHECK_FS is off case, I guess it's fine to not return and just print
> warning message for notice.
But if there is an exception, we don't know the type we originally wanted to count.
If they are all changed to meta, it is possible to get a wrong statistic. I think
there is no need to make statistics on this kind of error scene. Just like in the
next patch, if iostat_lat_type is wrong, we should return directly instead of changing
the value beyond the range to WRITE_ASYNC_IO.
So it's no need tp merge these two check condition?
Thx,
Yangtao
Powered by blists - more mailing lists