summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2021-12-09 10:25:43 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2021-12-14 11:17:48 -0800
commit19bdba5265624ba6b9d9dd936a0c6ccc167cfe80 (patch)
treef42c4b1098ac55edd11e32cc816fc7beb2bfb933 /fs/f2fs/file.c
parent325163e9892b627fc9fb1af51e51f0f95dded517 (diff)
downloadlinux-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/file.c')
-rw-r--r--fs/f2fs/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index a15f8ba239f0..5ec6bef3937f 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -3145,17 +3145,17 @@ static int f2fs_ioc_set_pin_file(struct file *filp, unsigned long arg)
inode_lock(inode);
- if (f2fs_should_update_outplace(inode, NULL)) {
- ret = -EINVAL;
- goto out;
- }
-
if (!pin) {
clear_inode_flag(inode, FI_PIN_FILE);
f2fs_i_gc_failures_write(inode, 0);
goto done;
}
+ if (f2fs_should_update_outplace(inode, NULL)) {
+ ret = -EINVAL;
+ goto out;
+ }
+
if (f2fs_pin_file_control(inode, false)) {
ret = -EAGAIN;
goto out;