You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
f2fs: avoid writing 0'th page in volatile writes
The first page of volatile writes usually contains a sort of header information which will be used for recovery. (e.g., journal header of sqlite) If this is written without other journal data, user needs to handle the stale journal information. Acked-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
+4
-2
@@ -1177,8 +1177,10 @@ write:
|
|||||||
goto redirty_out;
|
goto redirty_out;
|
||||||
if (f2fs_is_drop_cache(inode))
|
if (f2fs_is_drop_cache(inode))
|
||||||
goto out;
|
goto out;
|
||||||
if (f2fs_is_volatile_file(inode) && !wbc->for_reclaim &&
|
/* we should not write 0'th page having journal header */
|
||||||
available_free_memory(sbi, BASE_CHECK))
|
if (f2fs_is_volatile_file(inode) && (!page->index ||
|
||||||
|
(!wbc->for_reclaim &&
|
||||||
|
available_free_memory(sbi, BASE_CHECK))))
|
||||||
goto redirty_out;
|
goto redirty_out;
|
||||||
|
|
||||||
/* Dentry blocks are controlled by checkpoint */
|
/* Dentry blocks are controlled by checkpoint */
|
||||||
|
|||||||
Reference in New Issue
Block a user