[f2fs-dev] [PATCH] fsck.f2fs: simplify fsck_chk_quota_node in PREEN_MODE_1

2018-03-26 Thread Junling Zheng
Do not do fsck_chk_node_blk to simplify fsck_chk_quota_node in
PREEN_MODE_1, as well as fsck_chk_orphan_node.

Signed-off-by: Junling Zheng 
---
 fsck/fsck.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index bc91839..91c8529 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -1671,6 +1671,7 @@ int fsck_chk_quota_node(struct f2fs_sb_info *sbi)
if (!IS_VALID_NID(sbi, ino) ||
!IS_VALID_BLK_ADDR(sbi, ni.blk_addr))
return -EINVAL;
+   continue;
}
ret = fsck_chk_node_blk(sbi, NULL, ino,
F2FS_FT_REG_FILE, TYPE_INODE, _cnt, NULL);
-- 
2.16.2


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH] f2fs: Add a segment type check in inplace write

2018-03-26 Thread Yunlei He
This patch add a segment type check in IPU, in
case of something wrong with blkadd in dnode.

Signed-off-by: Yunlei He 
---
 fs/f2fs/segment.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index f61c77b..c55942c 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2790,10 +2790,15 @@ void write_data_page(struct dnode_of_data *dn, struct 
f2fs_io_info *fio)
 int rewrite_data_page(struct f2fs_io_info *fio)
 {
int err;
+   struct f2fs_sb_info *sbi = fio->sbi;
 
fio->new_blkaddr = fio->old_blkaddr;
/* i/o temperature is needed for passing down write hints */
__get_segment_type(fio);
+
+   f2fs_bug_on(sbi, !IS_DATASEG(get_seg_entry(sbi,
+   GET_SEGNO(sbi, fio->new_blkaddr))->type));
+
stat_inc_inplace_blocks(fio->sbi);
 
err = f2fs_submit_page_bio(fio);
-- 
1.9.1


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel