f2fs: don't allow any writes on aborted atomic writes
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 27 Jul 2018 09:15:11 +0000 (18:15 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 1 Aug 2018 18:52:36 +0000 (11:52 -0700)
commit455e3a5887ee7ebec5c885a8f398c2c3c0a33165
tree83f2e4f0dadb9be1197a6421b7fadd818e07fe61
parent797c1cb56ba58bf42742e9446226345a6216d832
f2fs: don't allow any writes on aborted atomic writes

In order to prevent abusing atomic writes by abnormal users, we've added a
threshold, 20% over memory footprint, which disallows further atomic writes.
Previously, however, SQLite doesn't know the files became normal, so that
it could write stale data and commit on revoked normal database file.

Once f2fs detects such the abnormal behavior, this patch tries to avoid further
writes in write_begin().

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/file.c