diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-12-09 10:25:43 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-12-14 11:17:48 -0800 |
commit | 19bdba5265624ba6b9d9dd936a0c6ccc167cfe80 (patch) | |
tree | f42c4b1098ac55edd11e32cc816fc7beb2bfb933 /fs/f2fs/data.c | |
parent | 325163e9892b627fc9fb1af51e51f0f95dded517 (diff) | |
download | linux-stable-19bdba5265624ba6b9d9dd936a0c6ccc167cfe80.tar.gz linux-stable-19bdba5265624ba6b9d9dd936a0c6ccc167cfe80.tar.bz2 linux-stable-19bdba5265624ba6b9d9dd936a0c6ccc167cfe80.zip |
f2fs: avoid EINVAL by SBI_NEED_FSCK when pinning a file
Android OTA failed due to SBI_NEED_FSCK flag when pinning the file. Let's avoid
it since we can do in-place-updates.
Cc: stable@vger.kernel.org
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index a9652a8e669b..40c0d1426a11 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2525,6 +2525,11 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); + /* The below cases were checked when setting it. */ + if (f2fs_is_pinned_file(inode)) + return false; + if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK)) + return true; if (f2fs_lfs_mode(sbi)) return true; if (S_ISDIR(inode->i_mode)) @@ -2533,8 +2538,6 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) return true; if (f2fs_is_atomic_file(inode)) return true; - if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) - return true; /* swap file is migrating in aligned write mode */ if (is_inode_flag_set(inode, FI_ALIGNED_WRITE)) |