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)
commitea4cfe08cfc34a887985741a737ee4c5ae3a6d98
tree7bf698d633becd367587bd6bd2e170c66b4ca663
parent5f6c0ba3f0fefb9b68bbba12b447e4d92ca0c8a2
LU-18097 pcc: use filemap_write_and_wait() for mmap switch

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