Whamcloud - gitweb
LU-16433 llite: check vvp_account_page_dirtied 12/49512/6
authorJian Yu <yujian@whamcloud.com>
Thu, 29 Dec 2022 08:21:32 +0000 (00:21 -0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 3 Jan 2023 21:36:06 +0000 (21:36 +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.

Test-Parameters: trivial clientdistro=el8.6 testlist=sanity

Test-Parameters: trivial clientdistro=el8.7 testlist=sanity

Test-Parameters: trivial clientdistro=el9.0 \
env=SANITY_EXCEPT="130 244a" testlist=sanity

Test-Parameters: trivial clientdistro=sles15sp4 \
env=SANITY_EXCEPT="27J 101j 244a" testlist=sanity

Change-Id: I272033d7494a157145224b1b8ce999a80958aa6c
Fixes: 4bf090b811 ("LU-15959 kernel: new kernel [SLES15 SP4 5.14.21-150400.24.18.1]")
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49512
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Shuichi Ihara <sihara@ddn.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
lustre/llite/vvp_io.c

index 67066ec..dbb918a 100644 (file)
@@ -1022,25 +1022,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];
 
@@ -1090,7 +1086,6 @@ void vvp_set_pagevec_dirty(struct pagevec *pvec)
                /* !PageAnon && !swapper_space */
                __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
        }
-end:
 #endif
        EXIT;
 }