From: Jian Yu Date: Thu, 29 Dec 2022 08:24:13 +0000 (-0800) Subject: LU-16433 llite: check vvp_account_page_dirtied X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=174c83d6b744b0b82d181e477da0a8b83dba595d;p=fs%2Flustre-release.git LU-16433 llite: check vvp_account_page_dirtied 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 Change-Id: I272033d7494a157145224b1b8ce999a80958aa6c Reviewed-by: Yang Sheng Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50025 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index d548693..ac96aee 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -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; }