Skip to contentSkip to conversation

f2fs: inline: fix minor bugs in f2fs_recover_inline_data

PATCH Superseded Jack Qiu 2 participants 5 messages Dec 7, 2020 F2FS file system

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jack Qiu

author
#0 lore raw

v2 cover f2fs: inline: fix minor bugs in f2fs_recover_inline_data

Jack Qiu (3):
f2fs: inline: correct comment in f2fs_recover_inline_data
f2fs: inline: remove redundant FI_DATA_EXIST set
f2fs: inline: fix wrong inline inode stat

 fs/f2fs/inline.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--
2.17.1

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author
#1 lore raw

PATCH v2 1/3 f2fs: inline: correct comment in f2fs_recover_inline_data

In 3rd scene, it should remove data blocks instead of inline_data.

---
 fs/f2fs/inline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/inline.c +1 -1
index 70384e31788d..0399531efcd3 100644
@@ -266,7 +266,7 @@ int f2fs_recover_inline_data(struct inode *inode, struct page *npage)
 	 * [prev.] [next] of inline_data flag
 	 *    o       o  -> recover inline_data
 	 *    o       x  -> remove inline_data, and then recover data blocks
-	 *    x       o  -> remove inline_data, and then recover inline_data
+	 *    x       o  -> remove data blocks, and then recover inline_data
 	 *    x       x  -> recover data blocks
 	 */
 	if (IS_INODE(npage))

--
2.17.1

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author
#2 lore raw

PATCH v2 2/3 f2fs: inline: remove redundant FI_DATA_EXIST set

In reply to Jack Qiu

FI_DATA_EXIST has been set in recover_inline_flags, no need set in f2fs_recover_inline_data again. Just remove it.

---
 fs/f2fs/inline.c | 1 -
 1 file changed, 1 deletion(-)
fs/f2fs/inline.c +0 -1
index 0399531efcd3..0a8f7eefca7d 100644
@@ -286,7 +286,6 @@ int f2fs_recover_inline_data(struct inode *inode, struct page *npage)
 		memcpy(dst_addr, src_addr, MAX_INLINE_DATA(inode));
 
 		set_inode_flag(inode, FI_INLINE_DATA);
-		set_inode_flag(inode, FI_DATA_EXIST);
 
 		set_page_dirty(ipage);
 		f2fs_put_page(ipage, 1);

--
2.17.1

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

author
#3 lore raw

PATCH v2 3/3 f2fs: inline: fix wrong inline inode stat

In reply to Jack Qiu

Miss to stat inline inode in f2fs_recover_inline_data.

---
 fs/f2fs/inline.c | 2 ++
 1 file changed, 2 insertions(+)
fs/f2fs/inline.c +2 -0
index 0a8f7eefca7d..c37747f7028c 100644
@@ -297,6 +297,7 @@ int f2fs_recover_inline_data(struct inode *inode, struct page *npage)
 		if (IS_ERR(ipage))
 			return PTR_ERR(ipage);
 		f2fs_truncate_inline_inode(inode, ipage, 0);
+		stat_dec_inline_inode(inode);
 		clear_inode_flag(inode, FI_INLINE_DATA);
 		f2fs_put_page(ipage, 1);
 	} else if (ri && (ri->i_inline & F2FS_INLINE_DATA)) {
@@ -305,6 +306,7 @@ int f2fs_recover_inline_data(struct inode *inode, struct page *npage)
 		ret = f2fs_truncate_blocks(inode, 0, false);
 		if (ret)
 			return ret;
+		stat_inc_inline_inode(inode);
 		goto process_inline;
 	}
 	return 0;

--
2.17.1

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#4 lore raw
In reply to Jack Qiu

Hi Jack,

I think you should add my reviewed-by tag in patch 1/3 and 3/3 when you send v2 patchset, otherwise, I may need to reply again, that's unneeded.

Quoted 13 lines · Jack Qiu

Jack Qiu (3):
f2fs: inline: correct comment in f2fs_recover_inline_data
f2fs: inline: remove redundant FI_DATA_EXIST set
f2fs: inline: fix wrong inline inode stat

  fs/f2fs/inline.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

--
2.17.1

Quoted 6 lines

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
.

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel