diff options
author | Yan, Zheng | 2013-04-12 21:45:42 +0800 |
---|---|---|
committer | Sage Weil | 2013-05-01 21:18:55 -0700 |
commit | 1ac0fc8adfc725660ee53a953b06855f64f8e792 (patch) | |
tree | eeaaaf8462b98de6775c5df323cc714ada1b95d2 /net/ceph | |
parent | 03d254edebe51949a569c38df6b4b05b7f3c50f9 (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