Skip to content
  • Yan, Zheng's avatar
    ceph: fix request max size · 3871cbb9
    Yan, Zheng authored
    
    
    ceph_check_caps() requests new max size only when there is Fw cap.
    If we call check_max_size() while there is no Fw cap. It updates
    i_wanted_max_size and calls ceph_check_caps(), but ceph_check_caps()
    does nothing. Later when Fw cap is issued, we call check_max_size()
    again. But i_wanted_max_size is equal to 'endoff' at this time, so
    check_max_size() doesn't call ceph_check_caps() and we end up with
    waiting for the new max size forever.
    
    The fix is duplicate ceph_check_caps()'s "request max size" code in
    check_max_size(), and make try_get_cap_refs() wait for the Fw cap
    before retry requesting new max size.
    
    This patch also removes the "endoff > (inode->i_size << 1)" check
    in check_max_size(). It's useless because there is no corresponding
    logic in ceph_check_caps().
    
    Reviewed-by: default avatarSage Weil <sage@inktank.com>
    Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
    3871cbb9