[f2fs-dev] Unfixed bug in f2fs-dev branch

2018-06-29 Thread Xu, Wen
Hi Chao,

Thank you for your quick response for my bugs!

After testing your patches, I found all my bugs are fixed except for 
https://bugzilla.kernel.org/show_bug.cgi?id=200179
The kernel still panics with KASAN report that I have already pasted in the 
link. Please check it.

-Wen
--
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


Re: [f2fs-dev] [PATCH v14 68/74] dax: Convert dax_lock_page to XArray

2018-06-29 Thread Ross Zwisler
On Sat, Jun 16, 2018 at 07:00:46PM -0700, Matthew Wilcox wrote:
> Signed-off-by: Matthew Wilcox 
> ---
<>
> +static void *dax_make_page_entry(struct page *page, void *entry)
> +{
> + pfn_t pfn = page_to_pfn_t(page);
> + return dax_make_entry(pfn, dax_is_pmd_entry(entry));
> +}

This function is defined and never used, so we get:

fs/dax.c:106:14: warning: ‘dax_make_page_entry’ defined but not used 
[-Wunused-function]
 static void *dax_make_page_entry(struct page *page, void *entry)
  ^~~

--
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] dump.f2fs: only dump nat inside the specified nid range

2018-06-29 Thread Junling Zheng
Only dump nat info of nids inside the specified range.

Signed-off-by: Junling Zheng 
---
 fsck/dump.c | 79 -
 fsck/fsck.h |  2 +-
 fsck/main.c |  4 +--
 3 files changed, 38 insertions(+), 47 deletions(-)

diff --git a/fsck/dump.c b/fsck/dump.c
index 9236a43..89cff83 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -31,32 +31,34 @@ const char *seg_type_name[SEG_TYPE_MAX + 1] = {
"SEG_TYPE_NONE",
 };
 
-void nat_dump(struct f2fs_sb_info *sbi)
+void nat_dump(struct f2fs_sb_info *sbi, int start_nat, int end_nat)
 {
-   struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi);
struct f2fs_nm_info *nm_i = NM_I(sbi);
struct f2fs_nat_block *nat_block;
struct f2fs_node *node_block;
-   u32 nr_nat_blks, nid;
+   u32 nid;
pgoff_t block_off;
pgoff_t block_addr;
char buf[BUF_SZ];
int seg_off;
int fd, ret, pack;
-   unsigned int i;
 
nat_block = (struct f2fs_nat_block *)calloc(BLOCK_SZ, 1);
node_block = (struct f2fs_node *)calloc(BLOCK_SZ, 1);
ASSERT(nat_block);
-
-   nr_nat_blks = get_sb(segment_count_nat) <<
-   (sbi->log_blocks_per_seg - 1);
+   ASSERT(node_block);
 
fd = open("dump_nat", O_CREAT|O_WRONLY|O_TRUNC, 0666);
ASSERT(fd >= 0);
 
-   for (block_off = 0; block_off < nr_nat_blks; pack = 1, block_off++) {
+   for (nid = start_nat; nid < end_nat; pack = 1, nid++) {
+   struct f2fs_nat_entry raw_nat;
+   struct node_info ni;
+   if(nid == 0 || nid == 1 || nid == 2 )
+   continue;
 
+   ni.nid = nid;
+   block_off = nid / NAT_ENTRY_PER_BLOCK;
seg_off = block_off >> sbi->log_blocks_per_seg;
block_addr = (pgoff_t)(nm_i->nat_blkaddr +
(seg_off << sbi->log_blocks_per_seg << 1) +
@@ -67,42 +69,11 @@ void nat_dump(struct f2fs_sb_info *sbi)
pack = 2;
}
 
-   ret = dev_read_block(nat_block, block_addr);
-   ASSERT(ret >= 0);
-
-   nid = block_off * NAT_ENTRY_PER_BLOCK;
-   for (i = 0; i < NAT_ENTRY_PER_BLOCK; i++) {
-   struct f2fs_nat_entry raw_nat;
-   struct node_info ni;
-   ni.nid = nid + i;
-
-   if(nid + i  == 0 || nid + i  == 1 || nid + i == 2 )
-   continue;
-   if (lookup_nat_in_journal(sbi, nid + i,
-   &raw_nat) >= 0) {
-   node_info_from_raw_nat(&ni, &raw_nat);
-   ret = dev_read_block(node_block, ni.blk_addr);
-   ASSERT(ret >= 0);
-   if (ni.blk_addr != 0x0) {
-   memset(buf, 0, BUF_SZ);
-   snprintf(buf, BUF_SZ,
-   "nid:%5u\tino:%5u\toffset:%5u"
-   "\tblkaddr:%10u\tpack:%d\n",
-   ni.nid, ni.ino,
-   
le32_to_cpu(node_block->footer.flag) >>
-   OFFSET_BIT_SHIFT,
-   ni.blk_addr, pack);
-   ret = write(fd, buf, strlen(buf));
-   ASSERT(ret >= 0);
-   }
-   } else {
-   node_info_from_raw_nat(&ni,
-   &nat_block->entries[i]);
-   if (ni.blk_addr == 0)
-   continue;
-
-   ret = dev_read_block(node_block, ni.blk_addr);
-   ASSERT(ret >= 0);
+   if (lookup_nat_in_journal(sbi, nid, &raw_nat) >= 0) {
+   node_info_from_raw_nat(&ni, &raw_nat);
+   ret = dev_read_block(node_block, ni.blk_addr);
+   ASSERT(ret >= 0);
+   if (ni.blk_addr != 0x0) {
memset(buf, 0, BUF_SZ);
snprintf(buf, BUF_SZ,
"nid:%5u\tino:%5u\toffset:%5u"
@@ -114,6 +85,26 @@ void nat_dump(struct f2fs_sb_info *sbi)
ret = write(fd, buf, strlen(buf));
ASSERT(ret >= 0);
}
+   } else {
+   ret = dev_read_block(nat_block, block_addr);
+   ASSERT(ret >= 0);
+   node_info_from_raw_nat(&ni,
+   &nat_block->entr