From patchwork Tue Jun 7 17:31:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Rees X-Patchwork-Id: 858382 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p57HV9tr013288 for ; Tue, 7 Jun 2011 17:31:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755935Ab1FGRbe (ORCPT ); Tue, 7 Jun 2011 13:31:34 -0400 Received: from int-mailstore01.merit.edu ([207.75.116.232]:51078 "EHLO int-mailstore01.merit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752067Ab1FGRbd (ORCPT ); Tue, 7 Jun 2011 13:31:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by int-mailstore01.merit.edu (Postfix) with ESMTP id 39E6530852D5; Tue, 7 Jun 2011 13:31:33 -0400 (EDT) X-Virus-Scanned: amavisd-new at int-mailstore01.merit.edu Received: from int-mailstore01.merit.edu ([127.0.0.1]) by localhost (int-mailstore01.merit.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DLlWe7AiRjkf; Tue, 7 Jun 2011 13:31:32 -0400 (EDT) Received: from merit.edu (host-17.subnet-17.med.umich.edu [141.214.17.17]) by int-mailstore01.merit.edu (Postfix) with ESMTPSA id A60B4305A9CC; Tue, 7 Jun 2011 13:31:32 -0400 (EDT) Date: Tue, 7 Jun 2011 13:31:31 -0400 From: Jim Rees To: Benny Halevy Cc: linux-nfs@vger.kernel.org, peter honeyman Subject: [PATCH 46/88] SQUASHME: pnfsblock: Fix missing extent in commit list Message-ID: <5f0b764a27be72fd2861ef4a5f7d1e13d9180635.1307464382.git.rees@umich.edu> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 07 Jun 2011 17:31:35 +0000 (UTC) From: Zhang Jingwang When offset is in the middle of a extent, we shouldn't step forward to offset + extent->be_length, otherwise we may miss some extents in commit list. Signed-off-by: Zhang Jingwang Signed-off-by: Benny Halevy --- fs/nfs/blocklayout/blocklayout.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index b0ad836..cf306e9 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -348,16 +348,13 @@ static void mark_extents_written(struct pnfs_block_layout *bl, end = (offset + count + PAGE_CACHE_SIZE - 1) & (long)(PAGE_CACHE_MASK); end >>= 9; while (isect < end) { + sector_t len; be = find_get_extent(bl, isect, NULL); BUG_ON(!be); /* FIXME */ - if (be->be_state != PNFS_BLOCK_INVALID_DATA) - isect += be->be_length; - else { - sector_t len; - len = min(end, be->be_f_offset + be->be_length) - isect; + len = min(end, be->be_f_offset + be->be_length) - isect; + if (be->be_state == PNFS_BLOCK_INVALID_DATA) mark_for_commit(be, isect, len); /* What if fails? */ - isect += len; - } + isect += len; put_extent(be); } }