OSDN Git Service

f2fs: Prevent swap file in LFS mode
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 10 May 2021 11:24:44 +0000 (20:24 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 14 May 2021 18:22:08 +0000 (11:22 -0700)
commitd927ccfccb009ede24448d69c08b12e7c8a6979b
tree9066ad0a4da1b9828ef376056af7e41cb6e20dea
parentcad83c968c2ebe97905f900326988ed37146c347
f2fs: Prevent swap file in LFS mode

The kernel writes to swap files on f2fs directly without the assistance
of the filesystem. This direct write by kernel can be non-sequential
even when the f2fs is in LFS mode. Such non-sequential write conflicts
with the LFS semantics. Especially when f2fs is set up on zoned block
devices, the non-sequential write causes unaligned write command errors.

To avoid the non-sequential writes to swap files, prevent swap file
activation when the filesystem is in LFS mode.

Fixes: 4969c06a0d83 ("f2fs: support swap file w/ DIO")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: stable@vger.kernel.org # v5.10+
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c