• Y
    ceph: fix race between writepages and truncate · 1ac0fc8a
    Yan, Zheng 提交于
    ceph_writepages_start() reads inode->i_size in two places. It can get
    different values between successive read, because truncate can change
    inode->i_size at any time. The race can lead to mismatch between data
    length of osd request and pages marked as writeback. When osd request
    finishes, it clear writeback page according to its data length. So
    some pages can be left in writeback state forever. The fix is only
    read inode->i_size once, save its value to a local variable and use
    the local variable when i_size is needed.
    Signed-off-by: NYan, Zheng <zheng.z.yan@intel.com>
    Reviewed-by: NAlex Elder <elder@inktank.com>
    1ac0fc8a
addr.c 33.7 KB