]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
erofs: fix setting up pcluster for temporary pages
authorGao Xiang <hsiangkao@redhat.com>
Thu, 22 Oct 2020 14:57:21 +0000 (22:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:23 +0000 (19:22 +0100)
commit a30573b3cdc77b8533d004ece1ea7c0146b437a0 upstream.

pcluster should be only set up for all managed pages instead of
temporary pages. Since it currently uses page->mapping to identify,
the impact is minor for now.

[ Update: Vladimir reported the kernel log becomes polluted
  because PAGE_FLAGS_CHECK_AT_FREE flag(s) set if the page
  allocation debug option is enabled. ]

Link: https://lore.kernel.org/r/20201022145724.27284-1-hsiangkao@aol.com
Fixes: 5ddcee1f3a1c ("erofs: get rid of __stagingpage_alloc helper")
Cc: <stable@vger.kernel.org> # 5.5+
Tested-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/erofs/zdata.c

index 6c939def00f9563340cdfaf85685f48706a42e42..118d9fe02c4e2b756bdcaa607ffeb6ad6d45fffa 100644 (file)
@@ -1080,8 +1080,11 @@ out_allocpage:
                cond_resched();
                goto repeat;
        }
-       set_page_private(page, (unsigned long)pcl);
-       SetPagePrivate(page);
+
+       if (tocache) {
+               set_page_private(page, (unsigned long)pcl);
+               SetPagePrivate(page);
+       }
 out:   /* the only exit (for tracing and debugging) */
        return page;
 }