From: Frederic Suter Date: Fri, 25 Sep 2015 14:24:01 +0000 (+0200) Subject: you can overwrite part of a file without mofiying its size X-Git-Tag: v3_12~117^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/706eb57e96a426be797b6552144fb7b2a21fcc28 you can overwrite part of a file without mofiying its size --- diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 42fef37138..6baacc2658 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -332,8 +332,10 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) action->p_storage->m_usedSize += incr; // disk usage action->p_file->current_position+= incr; // current_position - // which becomes the new file size - action->p_file->size = action->p_file->current_position ; + // which becomes the new file size only if it's greater than the current + // file size + if (action->p_file->current_position > action->p_file->size) + action->p_file->size = action->p_file->current_position ; sg_size_t *psize = xbt_new(sg_size_t,1); *psize = action->p_file->size;