From: Sage Weil Date: Sun, 6 Feb 2011 21:55:50 +0000 (-0800) Subject: client: more carefully gaurd local cache truncate X-Git-Tag: v0.24.3~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5a50d339ed71b960098a1b52d1a1c402f4451be8;p=ceph.git client: more carefully gaurd local cache truncate This fixes an assert when len=0 in file_to_extents when we get some weird metadata from the MDS. Fixes: #778 Signed-off-by: Sage Weil --- diff --git a/src/client/Client.cc b/src/client/Client.cc index c9876fc5b1b47..9f7fa9d90a0d9 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -380,7 +380,7 @@ void Client::update_inode_file_bits(Inode *in, << truncate_size << dendl; in->truncate_size = truncate_size; in->oset.truncate_size = truncate_size; - if (g_conf.client_oc && prior_size) { //do actual truncation + if (g_conf.client_oc && prior_size > truncate_size) { //do actual truncation vector ls; filer->file_to_extents(in->ino, &in->layout, truncate_size, prior_size - truncate_size,