]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: Fix i_size update race
authorSage Weil <sage@inktank.com>
Mon, 5 Nov 2012 19:07:23 +0000 (11:07 -0800)
committerSage Weil <sage@inktank.com>
Mon, 5 Nov 2012 19:07:23 +0000 (11:07 -0800)
commitce193614011fb8cc0b661ef393a18b20d6b3344e
tree82fc93d9c89ef41145e52ace63484047e600f866
parentf343db81341fe96bb0e264bee83ab115858921b4
ceph: Fix i_size update race

ceph_aio_write() has an optimization that marks cap EPH_CAP_FILE_WR
dirty before data is copied to page cache and inode size is updated.
If ceph_check_caps() flushes the dirty cap before the inode size is
updated, MDS can miss the new inode size. The fix is move
ceph_{get,put}_cap_refs() into ceph_write_{begin,end}() and call
__ceph_mark_dirty_caps() after inode size is updated.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
fs/ceph/addr.c
fs/ceph/file.c