Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760550Ab1CEBE6 (ORCPT ); Fri, 4 Mar 2011 20:04:58 -0500 Received: from kroah.org ([198.145.64.141]:47662 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751877Ab1CEBE4 (ORCPT ); Fri, 4 Mar 2011 20:04:56 -0500 X-Mailbox-Line: From gregkh@clark.kroah.org Fri Mar 4 17:03:52 2011 Message-Id: <20110305010351.939263080@clark.kroah.org> User-Agent: quilt/0.48-11.2 Date: Fri, 04 Mar 2011 17:02:55 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Tristan Ye , Joel Becker Subject: [01/18] Ocfs2/refcounttree: Fix a bug for refcounttree to writeback clusters in a right number. In-Reply-To: <20110305010410.GA18668@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1864 Lines: 57 2.6.32-longterm review patch. If anyone has any objections, please let us know. ------------------ From: Tristan Ye commit acf3bb007e5636ef4c17505affb0974175108553 upstream. Current refcounttree codes actually didn't writeback the new pages out in write-back mode, due to a bug of always passing a ZERO number of clusters to 'ocfs2_cow_sync_writeback', the patch tries to pass a proper one in. Signed-off-by: Tristan Ye Signed-off-by: Joel Becker Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/refcounttree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/fs/ocfs2/refcounttree.c +++ b/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); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/