Commit 55c9bb68 authored by Zhiguo Niu's avatar Zhiguo Niu Committed by Treehugger Robot
Browse files

UPSTREAM: f2fs: fix to avoid changing 'check only' behaior of recovery



The following two 'check only recovery' processes are very dependent on
the return value of f2fs_recover_fsync_data, especially when the return
value is greater than 0.
1. when device has readonly mode, shown as commit
23738e74 ("f2fs: fix to restrict mount condition on readonly block device")
2. mount optiont NORECOVERY or DISABLE_ROLL_FORWARD is set, shown as commit
6781eabb ("f2fs: give -EINVAL for norecovery and rw mount")

However, commit c426d991 ("f2fs: Check write pointer consistency of open zones")
will change the return value unexpectedly, thereby changing the caller's behavior

This patch let the f2fs_recover_fsync_data return correct value,and not do
f2fs_check_and_fix_write_pointer when the device is read-only.

Fixes: c426d991 ("f2fs: Check write pointer consistency of open zones")
Change-Id: I9d426257e2900b8558c78cc4e5dc8da56fd3cb30
Signed-off-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit edf3c086)
parent 2467ba65
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment