* [PATCH v2] f2fs: handle newly created page when revoking inmem pages
[not found] <CGME20180111001658epcas1p1e4a99f89bf1fabab2c22f46f939e3403@epcas1p1.samsung.com>
@ 2018-01-11 0:17 ` Daeho Jeong
2018-01-11 6:50 ` Yunlong Song
0 siblings, 1 reply; 5+ messages in thread
From: Daeho Jeong @ 2018-01-11 0:17 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel; +Cc: 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 <daeho.jeong@samsung.com>
Tested-by: Shu Tan <shu.tan@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
---
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, &ni);
- f2fs_replace_block(sbi, &dn, dn.data_blkaddr,
+ if (cur->old_addr == NEW_ADDR) {
+ invalidate_blocks(sbi, dn.data_blkaddr);
+ f2fs_update_data_blkaddr(&dn, NEW_ADDR);
+ } else
+ f2fs_replace_block(sbi, &dn, dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode(&dn);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages
2018-01-11 0:17 ` [PATCH v2] f2fs: handle newly created page when revoking inmem pages Daeho Jeong
@ 2018-01-11 6:50 ` Yunlong Song
2018-01-11 9:55 ` Chao Yu
[not found] ` <CGME20180111001658epcas1p1e4a99f89bf1fabab2c22f46f939e3403@epcms1p8>
0 siblings, 2 replies; 5+ messages in thread
From: Yunlong Song @ 2018-01-11 6:50 UTC (permalink / raw)
To: Daeho Jeong, linux-kernel, linux-f2fs-devel
Cc: heyunlei, yuchao0, Jaegeuk Kim
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 <daeho.jeong@samsung.com>
> Tested-by: Shu Tan <shu.tan@samsung.com>
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
> ---
> 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, &ni);
> - f2fs_replace_block(sbi, &dn, dn.data_blkaddr,
> + if (cur->old_addr == NEW_ADDR) {
> + invalidate_blocks(sbi, dn.data_blkaddr);
> + f2fs_update_data_blkaddr(&dn, NEW_ADDR);
> + } else
> + f2fs_replace_block(sbi, &dn, dn.data_blkaddr,
> cur->old_addr, ni.version, true, true);
> f2fs_put_dnode(&dn);
> }
>
--
Thanks,
Yunlong Song
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages
2018-01-11 6:50 ` Yunlong Song
@ 2018-01-11 9:55 ` Chao Yu
[not found] ` <CGME20180111001658epcas1p1e4a99f89bf1fabab2c22f46f939e3403@epcms1p8>
1 sibling, 0 replies; 5+ messages in thread
From: Chao Yu @ 2018-01-11 9:55 UTC (permalink / raw)
To: Yunlong Song, Daeho Jeong, linux-kernel, linux-f2fs-devel
Cc: heyunlei, Jaegeuk Kim
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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] f2fs: handle newly created page when revoking inmem pages
[not found] ` <CGME20180111001658epcas1p1e4a99f89bf1fabab2c22f46f939e3403@epcms1p8>
@ 2018-01-11 23:00 ` 정대호
0 siblings, 0 replies; 5+ messages in thread
From: 정대호 @ 2018-01-11 23:00 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel
Yes, Chao, you're right. :)
--------- Original Message ---------
Sender : Chao Yu <yuchao0@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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] f2fs: handle newly created page when revoking inmem pages
[not found] <CGME20180110074852epcas2p43c4891c689db01ff6fc46291a4dcfb75@epcas2p4.samsung.com>
@ 2018-01-10 7:49 ` Daeho Jeong
0 siblings, 0 replies; 5+ messages in thread
From: Daeho Jeong @ 2018-01-10 7:49 UTC (permalink / raw)
To: linux-kernel, linux-f2fs-devel; +Cc: 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 <daeho.jeong@samsung.com>
Tested-by: Shu Tan <shu.tan@samsung.com>
---
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, &ni);
- f2fs_replace_block(sbi, &dn, dn.data_blkaddr,
+ if (cur->old_addr == NEW_ADDR) {
+ invalidate_blocks(sbi, dn.data_blkaddr);
+ f2fs_update_data_blkaddr(&dn, NEW_ADDR);
+ } else
+ f2fs_replace_block(sbi, &dn, dn.data_blkaddr,
cur->old_addr, ni.version, true, true);
f2fs_put_dnode(&dn);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-01-11 23:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20180111001658epcas1p1e4a99f89bf1fabab2c22f46f939e3403@epcas1p1.samsung.com>
2018-01-11 0:17 ` [PATCH v2] f2fs: handle newly created page when revoking inmem pages Daeho Jeong
2018-01-11 6:50 ` Yunlong Song
2018-01-11 9:55 ` Chao Yu
[not found] ` <CGME20180111001658epcas1p1e4a99f89bf1fabab2c22f46f939e3403@epcms1p8>
2018-01-11 23:00 ` 정대호
[not found] <CGME20180110074852epcas2p43c4891c689db01ff6fc46291a4dcfb75@epcas2p4.samsung.com>
2018-01-10 7:49 ` Daeho Jeong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).