Whamcloud - gitweb
LU-18097 pcc: use filemap_write_and_wait() for mmap switch 74/55974/3
authorQian Yingjin <qian@ddn.com>
Thu, 8 Aug 2024 08:41:03 +0000 (16:41 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 22:03:07 +0000 (22:03 +0000)
During mmap() mapping switch, the client writes out and waits for
I/O by using filemap_write_and_wait_range() wrongly setting the
end with LUSTRE_EOF.

However, in the newer kernel, it uses [start=0, end=LLONG_MAX] to
determine whehter it is a whole range write-out.
i.e. write_cache_pages() or ext4_do_writepages().

Using LUSTRE_EOF as the end for the whole range write-out may
result in the data is not written out on the local PCC backend
(such as Ext4).
This results in the failures on sanity-pcc/{6, 7a, 7b, 23, 35} on
the kernel newer than rhel8.9.

We fix this error by using filemap_write_and_wait() instead in
which it uses LLONG_MAX as the end of the whole range writeout
by default.

Test-Parameters: testlist=sanity-pcc clientdistro=el9.4
Test-Parameters: testlist=sanity-pcc clientdistro=el8.9
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I412e0f5b32195fcc6a5a1711352e0fb5e7650338
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55974
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/pcc.c
lustre/tests/sanity-pcc.sh

index 5c118af..32cfd90 100644 (file)
@@ -2113,7 +2113,7 @@ static inline void pcc_inode_mapping_reset(struct inode *inode)
         * The file is detaching, firstly write out all dirty pages and then
         * unmap and remove all pagecache associated with the PCC backend.
         */
-       rc = filemap_write_and_wait_range(mapping, 0, LUSTRE_EOF);
+       rc = filemap_write_and_wait(mapping);
        if (rc)
                CWARN("%s: Failed to write out data for file fid="DFID"\n",
                      ll_i2sbi(inode)->ll_fsname, PFID(ll_inode2fid(inode)));
@@ -2895,7 +2895,7 @@ static int pcc_mmap_mapping_set(struct inode *inode, struct inode *pcc_inode)
         * mapping from the PCC copy to the Lustre file for PCC mmap().
         */
 
-       rc = filemap_write_and_wait_range(mapping, 0, LUSTRE_EOF);
+       rc = filemap_write_and_wait(mapping);
        if (rc)
                return rc;
 
@@ -2905,7 +2905,7 @@ static int pcc_mmap_mapping_set(struct inode *inode, struct inode *pcc_inode)
        wait_event_idle(pcci->pcci_waitq,
                        atomic_read(&pcci->pcci_active_ios) == 0);
 
-       rc = filemap_write_and_wait_range(pcc_inode->i_mapping, 0, LUSTRE_EOF);
+       rc = filemap_write_and_wait(pcc_inode->i_mapping);
        if (rc)
                return rc;
 
index 6a916e6..92b9ec4 100755 (executable)
@@ -57,7 +57,6 @@ fi
 if [[ -r /etc/redhat-release ]]; then
        rhel_version=$(sed -e 's/[^0-9.]*//g' /etc/redhat-release)
        if (( $(version_code $rhel_version) >= $(version_code 9.3.0) )); then
-               always_except EX-8739 6 7a 7b 23 35 # PCC-RW
                always_except LU-17289 102          # fio io_uring
                always_except LU-17781 33           # inconsistent LSOM
        elif (( $(version_code $rhel_version) >= $(version_code 8.9.0) )); then