Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-11 Thread 정대호
Yes, Chao, you're right. :)

 
- Original Message -
Sender : Chao Yu <yuch...@huawei.com>
Date   : 2018-01-11 18:55 (GMT+9)
Title  : Re: [PATCH v2] f2fs: handle newly created page when revoking inmem 
pages
 
 
> I guess Daeho want to say "Partially successful"?
 
> Thanks,
 
 
 


Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-11 Thread 정대호
Yes, Chao, you're right. :)

 
- Original Message -
Sender : Chao Yu 
Date   : 2018-01-11 18:55 (GMT+9)
Title  : Re: [PATCH v2] f2fs: handle newly created page when revoking inmem 
pages
 
 
> I guess Daeho want to say "Partially successful"?
 
> Thanks,
 
 
 


Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-11 Thread Chao Yu
On 2018/1/11 14:50, Yunlong Song wrote:
> Should it be "When committing inmem pages is not successful" ?

I guess Daeho want to say "Partially successful"?

Thanks,



Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-11 Thread Chao Yu
On 2018/1/11 14:50, Yunlong Song wrote:
> Should it be "When committing inmem pages is not successful" ?

I guess Daeho want to say "Partially successful"?

Thanks,



Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-10 Thread Yunlong Song

Should it be "When committing inmem pages is not successful" ?

On 2018/1/11 8:17, Daeho Jeong wrote:

When committing inmem pages is successful, we revoke already committed
blocks in __revoke_inmem_pages() and finally replace the committed
ones with the old blocks using f2fs_replace_block(). However, if
the committed block was newly created one, the address of the old
block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
as new_blkaddr properly and a kernel panic occurrs.

Signed-off-by: Daeho Jeong 
Tested-by: Shu Tan 
Reviewed-by: Chao Yu 
---
  fs/f2fs/segment.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c117e09..0673d08 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -248,7 +248,11 @@ static int __revoke_inmem_pages(struct inode *inode,
goto next;
}
get_node_info(sbi, dn.nid, );
-   f2fs_replace_block(sbi, , dn.data_blkaddr,
+   if (cur->old_addr == NEW_ADDR) {
+   invalidate_blocks(sbi, dn.data_blkaddr);
+   f2fs_update_data_blkaddr(, NEW_ADDR);
+   } else
+   f2fs_replace_block(sbi, , dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode();
}



--
Thanks,
Yunlong Song



Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-10 Thread Yunlong Song

Should it be "When committing inmem pages is not successful" ?

On 2018/1/11 8:17, Daeho Jeong wrote:

When committing inmem pages is successful, we revoke already committed
blocks in __revoke_inmem_pages() and finally replace the committed
ones with the old blocks using f2fs_replace_block(). However, if
the committed block was newly created one, the address of the old
block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
as new_blkaddr properly and a kernel panic occurrs.

Signed-off-by: Daeho Jeong 
Tested-by: Shu Tan 
Reviewed-by: Chao Yu 
---
  fs/f2fs/segment.c | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c117e09..0673d08 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -248,7 +248,11 @@ static int __revoke_inmem_pages(struct inode *inode,
goto next;
}
get_node_info(sbi, dn.nid, );
-   f2fs_replace_block(sbi, , dn.data_blkaddr,
+   if (cur->old_addr == NEW_ADDR) {
+   invalidate_blocks(sbi, dn.data_blkaddr);
+   f2fs_update_data_blkaddr(, NEW_ADDR);
+   } else
+   f2fs_replace_block(sbi, , dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode();
}



--
Thanks,
Yunlong Song



[PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-10 Thread Daeho Jeong
When committing inmem pages is successful, we revoke already committed
blocks in __revoke_inmem_pages() and finally replace the committed
ones with the old blocks using f2fs_replace_block(). However, if
the committed block was newly created one, the address of the old
block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
as new_blkaddr properly and a kernel panic occurrs.

Signed-off-by: Daeho Jeong 
Tested-by: Shu Tan 
Reviewed-by: Chao Yu 
---
 fs/f2fs/segment.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c117e09..0673d08 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -248,7 +248,11 @@ static int __revoke_inmem_pages(struct inode *inode,
goto next;
}
get_node_info(sbi, dn.nid, );
-   f2fs_replace_block(sbi, , dn.data_blkaddr,
+   if (cur->old_addr == NEW_ADDR) {
+   invalidate_blocks(sbi, dn.data_blkaddr);
+   f2fs_update_data_blkaddr(, NEW_ADDR);
+   } else
+   f2fs_replace_block(sbi, , dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode();
}
-- 
1.9.1



[PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-10 Thread Daeho Jeong
When committing inmem pages is successful, we revoke already committed
blocks in __revoke_inmem_pages() and finally replace the committed
ones with the old blocks using f2fs_replace_block(). However, if
the committed block was newly created one, the address of the old
block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
as new_blkaddr properly and a kernel panic occurrs.

Signed-off-by: Daeho Jeong 
Tested-by: Shu Tan 
Reviewed-by: Chao Yu 
---
 fs/f2fs/segment.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c117e09..0673d08 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -248,7 +248,11 @@ static int __revoke_inmem_pages(struct inode *inode,
goto next;
}
get_node_info(sbi, dn.nid, );
-   f2fs_replace_block(sbi, , dn.data_blkaddr,
+   if (cur->old_addr == NEW_ADDR) {
+   invalidate_blocks(sbi, dn.data_blkaddr);
+   f2fs_update_data_blkaddr(, NEW_ADDR);
+   } else
+   f2fs_replace_block(sbi, , dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode();
}
-- 
1.9.1



Re: [f2fs-dev] [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-10 Thread Chao Yu
On 2018/1/10 15:49, Daeho Jeong wrote:
> When committing inmem pages is successful, we revoke already committed
> blocks in __revoke_inmem_pages() and finally replace the committed
> ones with the old blocks using f2fs_replace_block(). However, if
> the committed block was newly created one, the address of the old
> block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
> as new_blkaddr properly and a kernel panic occurrs.
> 
> Signed-off-by: Daeho Jeong 
> Tested-by: Shu Tan 

Reviewed-by: Chao Yu 

Thanks,


Re: [f2fs-dev] [PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-10 Thread Chao Yu
On 2018/1/10 15:49, Daeho Jeong wrote:
> When committing inmem pages is successful, we revoke already committed
> blocks in __revoke_inmem_pages() and finally replace the committed
> ones with the old blocks using f2fs_replace_block(). However, if
> the committed block was newly created one, the address of the old
> block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
> as new_blkaddr properly and a kernel panic occurrs.
> 
> Signed-off-by: Daeho Jeong 
> Tested-by: Shu Tan 

Reviewed-by: Chao Yu 

Thanks,


[PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-09 Thread Daeho Jeong
When committing inmem pages is successful, we revoke already committed
blocks in __revoke_inmem_pages() and finally replace the committed
ones with the old blocks using f2fs_replace_block(). However, if
the committed block was newly created one, the address of the old
block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
as new_blkaddr properly and a kernel panic occurrs.

Signed-off-by: Daeho Jeong 
Tested-by: Shu Tan 
---
 fs/f2fs/segment.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c117e09..0673d08 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -248,7 +248,11 @@ static int __revoke_inmem_pages(struct inode *inode,
goto next;
}
get_node_info(sbi, dn.nid, );
-   f2fs_replace_block(sbi, , dn.data_blkaddr,
+   if (cur->old_addr == NEW_ADDR) {
+   invalidate_blocks(sbi, dn.data_blkaddr);
+   f2fs_update_data_blkaddr(, NEW_ADDR);
+   } else
+   f2fs_replace_block(sbi, , dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode();
}
-- 
1.9.1



[PATCH v2] f2fs: handle newly created page when revoking inmem pages

2018-01-09 Thread Daeho Jeong
When committing inmem pages is successful, we revoke already committed
blocks in __revoke_inmem_pages() and finally replace the committed
ones with the old blocks using f2fs_replace_block(). However, if
the committed block was newly created one, the address of the old
block is NEW_ADDR and __f2fs_replace_block() cannot handle NEW_ADDR
as new_blkaddr properly and a kernel panic occurrs.

Signed-off-by: Daeho Jeong 
Tested-by: Shu Tan 
---
 fs/f2fs/segment.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c117e09..0673d08 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -248,7 +248,11 @@ static int __revoke_inmem_pages(struct inode *inode,
goto next;
}
get_node_info(sbi, dn.nid, );
-   f2fs_replace_block(sbi, , dn.data_blkaddr,
+   if (cur->old_addr == NEW_ADDR) {
+   invalidate_blocks(sbi, dn.data_blkaddr);
+   f2fs_update_data_blkaddr(, NEW_ADDR);
+   } else
+   f2fs_replace_block(sbi, , dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode();
}
-- 
1.9.1