path: root/net/ceph
diff options
authorYan, Zheng <zheng.z.yan@intel.com>2013-04-12 21:45:42 +0800
committerSage Weil <sage@inktank.com>2013-05-01 21:18:55 -0700
commit1ac0fc8adfc725660ee53a953b06855f64f8e792 (patch)
treeeeaaaf8462b98de6775c5df323cc714ada1b95d2 /net/ceph
parent03d254edebe51949a569c38df6b4b05b7f3c50f9 (diff)
ceph: fix race between writepages and truncate
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: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'net/ceph')
0 files changed, 0 insertions, 0 deletions

Privacy Policy