]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
client: Make truncation work properly
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 26 Aug 2010 21:04:45 +0000 (14:04 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 26 Aug 2010 21:07:27 +0000 (14:07 -0700)
commit85814d45de05bcca390c39df020a7934e437c064
tree4a5f328190d77a9269f7585445ed6f5f140b15d4
parent610b2e9dae2213462af7a152308c4beed54974a4
client: Make truncation work properly
The previous if block didn't work because inode->size was usually
changed well before handle_cap_trunc was ever invoked, so it never
did the truncation in the objectcacher! This was okay if you just truncated
a file and then closed it, but if you wrote a file, truncated part of it out,
and then wrote past the (new) end you would get reads that returned
the previously-truncated data out of what should have been a hole.

Now, we do the actual objectcacher truncation in update_inode_file_bits,
because all methods of truncation will move through there and this maintains
proper ordering.
src/client/Client.cc