https://github.com/torvalds/linux
Revision 123aaf774f70ba48fb9ab064b6ce75a9b64d7b85 authored by Shin'ichiro Kawasaki on 19 August 2020, 01:34:48 UTC, committed by Jaegeuk Kim on 09 September 2020, 03:31:33 UTC
Commit da52f8ade40b ("f2fs: get the right gc victim section when section
has several segments") added code to count blocks of each section using
variables with type 'unsigned short', which has 2 bytes size in many
systems. However, the counts can be larger than the 2 bytes range and
type conversion results in wrong values. Especially when the f2fs
sections have blocks as many as USHRT_MAX + 1, the count is handled as 0.
This triggers eternal loop in init_dirty_segmap() at mount system call.
Fix this by changing the type of the variables to block_t.

Fixes: da52f8ade40b ("f2fs: get the right gc victim section when section has several segments")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 34d4ddd
History
Tip revision: 123aaf774f70ba48fb9ab064b6ce75a9b64d7b85 authored by Shin'ichiro Kawasaki on 19 August 2020, 01:34:48 UTC
f2fs: Fix type of section block count variables
Tip revision: 123aaf7
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format -rw-r--r-- 16.2 KB
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 71 bytes
.gitattributes -rw-r--r-- 62 bytes
.gitignore -rw-r--r-- 1.8 KB
.mailmap -rw-r--r-- 16.9 KB
COPYING -rw-r--r-- 496 bytes
CREDITS -rw-r--r-- 97.4 KB
Kbuild -rw-r--r-- 1.3 KB
Kconfig -rw-r--r-- 555 bytes
MAINTAINERS -rw-r--r-- 556.8 KB
Makefile -rw-r--r-- 61.7 KB
README -rw-r--r-- 727 bytes

README

back to top