All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fsck.f2fs: init quota_file before re-create quota file
@ 2018-07-12  3:36 Sheng Yong
  2018-07-12  9:45 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Sheng Yong @ 2018-07-12  3:36 UTC (permalink / raw)
  To: jaegeuk, yuchao0; +Cc: miaoxie, linux-f2fs-devel

`quota_handle->qh_qf->filesize' is not initialized by quota_create_file().
It contains random value, which is updated to quota file's i_size in
quota_file_close(). Since quota file is re-created, `filesize' can be
initialized as 0.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
 fsck/quotaio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fsck/quotaio.c b/fsck/quotaio.c
index afadf56..26f8a71 100644
--- a/fsck/quotaio.c
+++ b/fsck/quotaio.c
@@ -160,6 +160,7 @@ errcode_t quota_file_create(struct f2fs_sb_info *sbi, struct quota_handle *h,
 	f2fs_ino_t qf_inum = sb->qf_ino[qtype];
 	errcode_t err = 0;
 
+	memset(&h->qh_qf, 0, sizeof(h->qh_qf));
 	h->qh_qf.sbi = sbi;
 	h->qh_qf.ino = qf_inum;
 	h->write = quota_write_nomount;
-- 
2.17.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] fsck.f2fs: init quota_file before re-create quota file
  2018-07-12  3:36 [PATCH] fsck.f2fs: init quota_file before re-create quota file Sheng Yong
@ 2018-07-12  9:45 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2018-07-12  9:45 UTC (permalink / raw)
  To: Sheng Yong, jaegeuk; +Cc: miaoxie, linux-f2fs-devel

On 2018/7/12 11:36, Sheng Yong wrote:
> `quota_handle->qh_qf->filesize' is not initialized by quota_create_file().
> It contains random value, which is updated to quota file's i_size in
> quota_file_close(). Since quota file is re-created, `filesize' can be
> initialized as 0.
> 
> Signed-off-by: Sheng Yong <shengyong1@huawei.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,


------------------------------------------------------------------------------
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-07-12  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-12  3:36 [PATCH] fsck.f2fs: init quota_file before re-create quota file Sheng Yong
2018-07-12  9:45 ` 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.