mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 02:15:57 +00:00
f2fs: fix to check return value of f2fs_recover_xattr_data
Should check return value of f2fs_recover_xattr_data in __f2fs_setxattr rather than doing invalid retry if error happen. Also just do set_page_dirty in f2fs_recover_xattr_data when page is changed really. Fixes: 50a472bbc79f ("f2fs: do not return EFSCORRUPTED, but try to run online repair") Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
394e7f4dbb
commit
86d7d57a3f
@ -2751,11 +2751,11 @@ recover_xnid:
|
|||||||
f2fs_update_inode_page(inode);
|
f2fs_update_inode_page(inode);
|
||||||
|
|
||||||
/* 3: update and set xattr node page dirty */
|
/* 3: update and set xattr node page dirty */
|
||||||
if (page)
|
if (page) {
|
||||||
memcpy(F2FS_NODE(xpage), F2FS_NODE(page),
|
memcpy(F2FS_NODE(xpage), F2FS_NODE(page),
|
||||||
VALID_XATTR_BLOCK_SIZE);
|
VALID_XATTR_BLOCK_SIZE);
|
||||||
|
set_page_dirty(xpage);
|
||||||
set_page_dirty(xpage);
|
}
|
||||||
f2fs_put_page(xpage, 1);
|
f2fs_put_page(xpage, 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -660,11 +660,14 @@ retry:
|
|||||||
here = __find_xattr(base_addr, last_base_addr, NULL, index, len, name);
|
here = __find_xattr(base_addr, last_base_addr, NULL, index, len, name);
|
||||||
if (!here) {
|
if (!here) {
|
||||||
if (!F2FS_I(inode)->i_xattr_nid) {
|
if (!F2FS_I(inode)->i_xattr_nid) {
|
||||||
|
error = f2fs_recover_xattr_data(inode, NULL);
|
||||||
f2fs_notice(F2FS_I_SB(inode),
|
f2fs_notice(F2FS_I_SB(inode),
|
||||||
"recover xattr in inode (%lu)", inode->i_ino);
|
"recover xattr in inode (%lu), error(%d)",
|
||||||
f2fs_recover_xattr_data(inode, NULL);
|
inode->i_ino, error);
|
||||||
kfree(base_addr);
|
if (!error) {
|
||||||
goto retry;
|
kfree(base_addr);
|
||||||
|
goto retry;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
f2fs_err(F2FS_I_SB(inode), "set inode (%lu) has corrupted xattr",
|
f2fs_err(F2FS_I_SB(inode), "set inode (%lu) has corrupted xattr",
|
||||||
inode->i_ino);
|
inode->i_ino);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user