f2fs: silence VM_WARN_ON_ONCE in mempool_alloc
authorGao Xiang <gaoxiang25@huawei.com>
Tue, 19 Feb 2019 02:31:52 +0000 (10:31 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 13 Mar 2019 01:59:17 +0000 (18:59 -0700)
Note that __GFP_ZERO is not supported for mempool_alloc,
which also documented in the mempool_alloc comments.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index e099babf85bd3f01956b228f4bedbdc156872312..65c9586b2952f90ab47b6f31745da7472b3f3588 100644 (file)
@@ -299,9 +299,10 @@ static inline void __submit_bio(struct f2fs_sb_info *sbi,
                for (; start < F2FS_IO_SIZE(sbi); start++) {
                        struct page *page =
                                mempool_alloc(sbi->write_io_dummy,
-                                       GFP_NOIO | __GFP_ZERO | __GFP_NOFAIL);
+                                             GFP_NOIO | __GFP_NOFAIL);
                        f2fs_bug_on(sbi, !page);
 
+                       zero_user_segment(page, 0, PAGE_SIZE);
                        SetPagePrivate(page);
                        set_page_private(page, (unsigned long)DUMMY_WRITTEN_PAGE);
                        lock_page(page);