]> 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, 16 Sep 2010 23:54:46 +0000 (16:54 -0700)
commit22d211338f34d20196925093957379959f5a9b54
tree09a4027b8241c529b6a23d4cb5d13e4cbadbf348
parent1a4bbb7c4a71e1866cd81c234a64afc5df3201d6
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