* [PATCH] f2fs: Add a segment type check in inplace write
@ 2018-03-26 9:32 Yunlei He
2018-03-28 1:59 ` Chao Yu
0 siblings, 1 reply; 2+ messages in thread
From: Yunlei He @ 2018-03-26 9:32 UTC (permalink / raw)
To: jaegeuk, yuchao0, linux-f2fs-devel; +Cc: heyunlei
This patch add a segment type check in IPU, in
case of something wrong with blkadd in dnode.
Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] f2fs: Add a segment type check in inplace write
2018-03-26 9:32 [PATCH] f2fs: Add a segment type check in inplace write Yunlei He
@ 2018-03-28 1:59 ` Chao Yu
0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2018-03-28 1:59 UTC (permalink / raw)
To: Yunlei He, jaegeuk, linux-f2fs-devel
On 2018/3/26 17:32, Yunlei He wrote:
> This patch add a segment type check in IPU, in
> case of something wrong with blkadd in dnode.
>
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
> ---
> 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);
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-28 1:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-26 9:32 [PATCH] f2fs: Add a segment type check in inplace write Yunlei He
2018-03-28 1:59 ` Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.