Commit 435cbab9 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: fix quota_sync failure due to f2fs_lock_op

f2fs_quota_sync() uses f2fs_lock_op() before flushing dirty pages, but
f2fs_write_data_page() returns EAGAIN.
Likewise dentry blocks, we can just bypass getting the lock, since quota
blocks are also maintained by checkpoint.
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 8b83ac81
...@@ -985,7 +985,7 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, ...@@ -985,7 +985,7 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc,
loff_t psize; loff_t psize;
int i, err; int i, err;
if (!f2fs_trylock_op(sbi)) if (!IS_NOQUOTA(inode) && !f2fs_trylock_op(sbi))
return -EAGAIN; return -EAGAIN;
set_new_dnode(&dn, cc->inode, NULL, NULL, 0); set_new_dnode(&dn, cc->inode, NULL, NULL, 0);
...@@ -1092,7 +1092,8 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, ...@@ -1092,7 +1092,8 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc,
set_inode_flag(inode, FI_FIRST_BLOCK_WRITTEN); set_inode_flag(inode, FI_FIRST_BLOCK_WRITTEN);
f2fs_put_dnode(&dn); f2fs_put_dnode(&dn);
f2fs_unlock_op(sbi); if (!IS_NOQUOTA(inode))
f2fs_unlock_op(sbi);
spin_lock(&fi->i_size_lock); spin_lock(&fi->i_size_lock);
if (fi->last_disk_size < psize) if (fi->last_disk_size < psize)
...@@ -1118,7 +1119,8 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc, ...@@ -1118,7 +1119,8 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc,
out_put_dnode: out_put_dnode:
f2fs_put_dnode(&dn); f2fs_put_dnode(&dn);
out_unlock_op: out_unlock_op:
f2fs_unlock_op(sbi); if (!IS_NOQUOTA(inode))
f2fs_unlock_op(sbi);
return -EAGAIN; return -EAGAIN;
} }
......
...@@ -2659,8 +2659,8 @@ int f2fs_write_single_data_page(struct page *page, int *submitted, ...@@ -2659,8 +2659,8 @@ int f2fs_write_single_data_page(struct page *page, int *submitted,
f2fs_available_free_memory(sbi, BASE_CHECK)))) f2fs_available_free_memory(sbi, BASE_CHECK))))
goto redirty_out; goto redirty_out;
/* Dentry blocks are controlled by checkpoint */ /* Dentry/quota blocks are controlled by checkpoint */
if (S_ISDIR(inode->i_mode)) { if (S_ISDIR(inode->i_mode) || IS_NOQUOTA(inode)) {
fio.need_lock = LOCK_DONE; fio.need_lock = LOCK_DONE;
err = f2fs_do_write_data_page(&fio); err = f2fs_do_write_data_page(&fio);
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment