]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osdc/ObjectCacher: only call flush callback if we transitions to clean
authorSage Weil <sage@inktank.com>
Sat, 10 Nov 2012 02:34:22 +0000 (18:34 -0800)
committerSage Weil <sage@inktank.com>
Sat, 10 Nov 2012 02:34:22 +0000 (18:34 -0800)
commit8f49de0fb1ab6cd33c07fc382722ce37b42d74c8
treef9eff6898389d8d82ed7d182bd25afdc06476ef5
parent54f6c17ae319ee1e4c4459cf89969b5b6544e003
osdc/ObjectCacher: only call flush callback if we transitions to clean

If we race with e.g. truncate and are in bh_write_commit but the oset
is already clean, we should not call the flush callback (again).

This is reproduced by:

 - kludging slow osd replies into the code (e.g., 2 second delay)
 - mount ceph-fuse with --client-oc-max-dirty-age 1
 - dd if=/dev/zero of=mnt/foo count=1
   sleep 1
   truncate --size 0 mnt/foo
 -> crash

Signed-off-by: Sage Weil <sage@inktank.com>
src/osdc/ObjectCacher.cc