From: Zhang Jingwang <zhangjingwang@xxxxxxxxxxxx> 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 <zhangjingwang@xxxxxxxxxxxx> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx> --- 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); } } -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html