linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/3] f2fs: compress: fix to call f2fs_put_dnode() paired with f2fs_get_block()
@ 2021-05-10  9:30 Chao Yu
  2021-05-10  9:30 ` [f2fs-dev] [PATCH 2/3] f2fs: compress: fix race condition of overwrite vs truncate Chao Yu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chao Yu @ 2021-05-10  9:30 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

f2fs_get_block() and f2fs_put_dnode() should be called as a pair,
add missing f2fs_put_dnode() in prepare_compress_overwrite().

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/f2fs/compress.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index c208563eac28..d5cb0ba9a0e1 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -1088,6 +1088,7 @@ static int prepare_compress_overwrite(struct compress_ctx *cc,
 
 		for (i = cc->cluster_size - 1; i > 0; i--) {
 			ret = f2fs_get_block(&dn, start_idx + i);
+			f2fs_put_dnode(&dn);
 			if (ret) {
 				i = cc->cluster_size;
 				break;
-- 
2.29.2



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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-11  1:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-10  9:30 [f2fs-dev] [PATCH 1/3] f2fs: compress: fix to call f2fs_put_dnode() paired with f2fs_get_block() Chao Yu
2021-05-10  9:30 ` [f2fs-dev] [PATCH 2/3] f2fs: compress: fix race condition of overwrite vs truncate Chao Yu
2021-05-10  9:30 ` [f2fs-dev] [PATCH 3/3] f2fs: compress: fix to assign cc.cluster_idx correctly Chao Yu
2021-05-10 16:09   ` Jaegeuk Kim
2021-05-11  1:38     ` Chao Yu
2021-05-10 15:51 ` [f2fs-dev] [PATCH 1/3] f2fs: compress: fix to call f2fs_put_dnode() paired with f2fs_get_block() Jaegeuk Kim
2021-05-11  1:37   ` Chao Yu

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).