summary refs log tree commit diff
path: root/fs/splice.c
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>2019-12-09 19:44:44 +0900
committerJaegeuk Kim <jaegeuk@kernel.org>2020-01-15 13:42:14 -0800
commitc426d99127b1ab797f4cc355b18d77288978b2f2 (patch)
treea8f52ae265c516b33bc27c3a7e37b425ba639b42 /fs/splice.c
parentdd973007bfefe62c81e84cb6ae0704c73b2b64c9 (diff)
downloadlinux-c426d99127b1ab797f4cc355b18d77288978b2f2.tar.gz
f2fs: Check write pointer consistency of open zones
On sudden f2fs shutdown, write pointers of zoned block devices can go
further but f2fs meta data keeps current segments at positions before the
write operations. After remounting the f2fs, this inconsistency causes
write operations not at write pointers and "Unaligned write command"
error is reported.

To avoid the error, compare current segments with write pointers of open
zones the current segments point to, during mount operation. If the write
pointer position is not aligned with the current segment position, assign
a new zone to the current segment. Also check the newly assigned zone has
write pointer at zone start. If not, reset write pointer of the zone.

Perform the consistency check during fsync recovery. Not to lose the
fsync data, do the check after fsync data gets restored and before
checkpoint commit which flushes data at current segment positions. Not to
cause conflict with kworker's dirfy data/node flush, do the fix within
SBI_POR_DOING protection.

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>
Diffstat (limited to 'fs/splice.c')
0 files changed, 0 insertions, 0 deletions