Whamcloud - gitweb
LU-16433 llite: check vvp_account_page_dirtied
authorJian Yu <yujian@whamcloud.com>
Thu, 29 Dec 2022 08:24:13 +0000 (00:24 -0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 18 Feb 2023 19:13:39 +0000 (19:13 +0000)
This patch removes duplicated codes from vvp_set_pagevec_dirty()
and check vvp_account_page_dirtied to determine if falling back
to call __set_page_dirty_nobuffers().

HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT also needs to be checked because
vvp_account_page_dirtied is not defined if account_page_dirtied
is exported.

Lustre-change: https://review.whamcloud.com/49512
Lustre-commit: 61c4c2b5e5d7d919149921d913322586ba5ebcab

Test-Parameters: trivial clientdistro=sles15sp4 env=SANITY_EXCEPT="27J 101j 244a" testlist=sanity
Fixes: 3f0bee2502 ("LU-15959 kernel: new kernel [SLES15 SP4 5.14.21-150400.24.18.1]")
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Change-Id: I272033d7494a157145224b1b8ce999a80958aa6c
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50025
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/vvp_io.c

index d548693..ac96aee 100644 (file)
@@ -1027,25 +1027,21 @@ void vvp_set_pagevec_dirty(struct pagevec *pvec)
                 "mapping must be set. page %p, page->private (cl_page) %p\n",
                 page, (void *) page->private);
 
-/* kernels without HAVE_KALLSYMS_LOOKUP_NAME also don't have account_dirty_page
- * exported, and if we can't access that symbol, we can't do page dirtying in
- * batch (taking the xarray lock only once) so we just fall back to a looped
- * call to __set_page_dirty_nobuffers
- */
-#ifndef HAVE_KALLSYMS_LOOKUP_NAME
-       for (i = 0; i < count; i++)
-               __set_page_dirty_nobuffers(pvec->pages[i]);
-#else
        /*
-        * In kernel 5.14.21, kallsyms_lookup_name is defined but
-        * account_page_dirtied is not exported.
+        * kernels without HAVE_KALLSYMS_LOOKUP_NAME also don't have
+        * account_dirty_page exported, and if we can't access that symbol,
+        * we can't do page dirtying in batch (taking the xarray lock only once)
+        * so we just fall back to a looped call to __set_page_dirty_nobuffers
         */
+#ifndef HAVE_ACCOUNT_PAGE_DIRTIED_EXPORT
        if (!vvp_account_page_dirtied) {
                for (i = 0; i < count; i++)
                        __set_page_dirty_nobuffers(pvec->pages[i]);
-               goto end;
+               EXIT;
        }
+#endif
 
+#ifdef HAVE_KALLSYMS_LOOKUP_NAME
        for (i = 0; i < count; i++) {
                page = pvec->pages[i];
 
@@ -1095,7 +1091,6 @@ void vvp_set_pagevec_dirty(struct pagevec *pvec)
                /* !PageAnon && !swapper_space */
                __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
        }
-end:
 #endif
        EXIT;
 }