[f2fs-dev] [PATCH 1/2] f2fs: fix missing up_read

2018-09-28 Thread Jaegeuk Kim
This patch fixes missing up_read call.

Fixes: c9b60788fc76 ("f2fs: fix to do sanity check with block address in main 
area")
Cc:  # 4.19+
Signed-off-by: Jaegeuk Kim 
---
 fs/f2fs/node.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 3994b44541b4..acb819b8fc42 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1541,8 +1541,10 @@ static int __write_node_page(struct page *page, bool 
atomic, bool *submitted,
}
 
if (__is_valid_data_blkaddr(ni.blk_addr) &&
-   !f2fs_is_valid_blkaddr(sbi, ni.blk_addr, DATA_GENERIC))
+   !f2fs_is_valid_blkaddr(sbi, ni.blk_addr, DATA_GENERIC)) {
+   up_read(&sbi->node_write);
goto redirty_out;
+   }
 
if (atomic && !test_opt(sbi, NOBARRIER))
fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
-- 
2.19.0.605.g01d371f741-goog



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH 1/2] f2fs: fix missing up_read

2018-09-28 Thread Chao Yu
On 2018/9/29 1:48, Jaegeuk Kim wrote:
> This patch fixes missing up_read call.

I guess we need to add additional type of error injection to simulate
on-disk blkaddr corruption, then we can cover all those error paths.

> 
> Fixes: c9b60788fc76 ("f2fs: fix to do sanity check with block address in main 
> area")
> Cc:  # 4.19+
> Signed-off-by: Jaegeuk Kim 

Reviewed-by: Chao Yu 

Thanks,




___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel