!is_cold_data(page) &&
!IS_ATOMIC_WRITTEN_PAGE(page) &&
need_inplace_update(inode))) {
+ f2fs_unlock_op(F2FS_I_SB(inode));
+ fio->cp_rwsem_locked = false;
err = rewrite_data_page(fio);
set_inode_flag(inode, FI_UPDATE_WRITE);
trace_f2fs_do_write_data_page(page, IPU);
.page = page,
.encrypted_page = NULL,
.submitted = false,
+ .cp_rwsem_locked = true,
};
trace_f2fs_writepage(page, DATA);
err = do_write_data_page(&fio);
if (F2FS_I(inode)->last_disk_size < psize)
F2FS_I(inode)->last_disk_size = psize;
- f2fs_unlock_op(sbi);
+ if (fio.cp_rwsem_locked)
+ f2fs_unlock_op(sbi);
done:
if (err && err != -ENOENT)
goto redirty_out;
struct page *page; /* page to be written */
struct page *encrypted_page; /* encrypted page */
bool submitted; /* indicate IO submission */
+ bool cp_rwsem_locked; /* indicate cp_rwsem is held */
};
#define is_read_io(rw) ((rw) == READ)