OpenAFS Master Repository branch, openafs-stable-1_8_x, updated. openafs-stable-1_8_8_1-72-g99f04b1

Gerrit Code Review gerrit@openafs.org
Thu, 25 Aug 2022 08:51:01 -0400


The following commit has been merged in the openafs-stable-1_8_x branch:
commit 99f04b1398cc38fc18f7f98cca9d5785218feb0b
Author: Cheyenne Wills <cwills@sinenomine.net>
Date:   Thu Jul 14 13:03:08 2022 -0600

    linux: Call put_page if errors in aops->readpages
    
    Within the address_space_operations readpages function, when we remove a
    page from the page->lru list, we must ensure that the page reference
    count is decremented via put_page.
    
    There are two cases within the flow of the afs_linux_readpages where
    we remove a page from the page->lru list, but fail to put_page() it.
    
     - If we go through afs_linux_bypass_readpages we fail to call
       put_page() if the page index is larger than the index calculated from
       i_size_read for the cache file.
     - If get_dcache_readahead returns an error in afs_linux_readpages, we
       fail to put_page().  This can happen if there was a problem opening
       the cache file, or if the cache file has no a_ops->readpage.
    
    Add a call to put_page in afs_linux_bypass_readpages when the page index
    is greater than the index calculated from the i_size_read for the cache
    file.
    
    Add a call to put_page in afs_linux_readpages if get_dcache_readahead
    returns an error.
    
    Note: The condition of not calling put_page if there was an error
    opening the cache file was introduced by commit 'LINUX: Don't panic on
    some file open errors' (af73b9a3b1f), which replaced an assert with
    code that handled the error.  The other conditions have existed since
    the relevant code was introduced.
    
    In addition, the problems addressed by this commit are not present in
    Linux kernels 5.8 and greater when the commit 'Linux-5.18: replace
    readpages with readahead' (7a181415db1) is present, because we call
    afs_linux_readahead instead of afs_linux_readpages.
    
    Reviewed-on: https://gerrit.openafs.org/15068
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
    Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
    (cherry picked from commit 903dd5bf5e9328431e356abc42e20c248c5df6fd)
    
    Change-Id: I3679969f985e83a7291a5fb735c80f7d57429c29
    Reviewed-on: https://gerrit.openafs.org/15096
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
    Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

 src/afs/LINUX/osi_vnodeops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
OpenAFS Master Repository