[Ocfs2-tools-devel] A patch for ocfs2_truncate of libocfs2 in ocfs2-tools

tao.ma tao.ma at oracle.com
Thu Sep 7 02:07:06 PDT 2006


In libocfs2, ocfs2_truncate is used to change a file's size. But when
the new size is little than the original one which means we want to
shrink the file, the clusters will not be released and the file's
extend record will not be changed.
There are 2 places that need modification.
1. In ocfs2_truncate clusters is treated as uint32_t and passed into
following function, while in truncate_iterate, it is treated as
uint64_t, so the right number will not be got and extend record will not
be changed.
2. In update_leaf_rec, the wrong number and len of free cluster is got
and the cluster will not be released in the global bitmap.
Attachment is the patch.

-- 
* **     Tao Ma
*     Member of Techincal Staff *

Oracle Asia Development Center
Emerging Technology & Solution Development
*
Tel:        +86 10 8278 6026
URL:       OADC Intranet <http://cdc.oraclecorp.com/>, Oracle.com/cdc
<http://www.oracle.com/cdc/>



-------------- next part --------------
A non-text attachment was scrubbed...
Name: ocfs2_truncate.patch
Type: text/x-patch
Size: 1080 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-tools-devel/attachments/20060907/085d8d2a/ocfs2_truncate.bin


More information about the Ocfs2-tools-devel mailing list