Patch 2.6.32.28 to 2.6.32.32
/fs/ocfs2/refcounttree.c
blob:10e9527dda1f98cf0b0d5e0fa2c4610610990973 -> blob:8371a2527a9a317d2f54432eb6e6bc9914e06c6d
--- fs/ocfs2/refcounttree.c
+++ fs/ocfs2/refcounttree.c
@@ -3236,7 +3236,7 @@ static int ocfs2_make_clusters_writable(
u32 num_clusters, unsigned int e_flags)
{
int ret, delete, index, credits = 0;
- u32 new_bit, new_len;
+ u32 new_bit, new_len, orig_num_clusters;
unsigned int set_len;
struct ocfs2_super *osb = OCFS2_SB(sb);
handle_t *handle;
@@ -3269,6 +3269,8 @@ static int ocfs2_make_clusters_writable(
goto out;
}
+ orig_num_clusters = num_clusters;
+
while (num_clusters) {
ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh,
p_cluster, num_clusters,
@@ -3356,7 +3358,8 @@ static int ocfs2_make_clusters_writable(
* in write-back mode.
*/
if (context->get_clusters == ocfs2_di_get_clusters) {
- ret = ocfs2_cow_sync_writeback(sb, context, cpos, num_clusters);
+ ret = ocfs2_cow_sync_writeback(sb, context, cpos,
+ orig_num_clusters);
if (ret)
mlog_errno(ret);
}