From 01eda42e0db8b53da71d771539019967c3de977f Mon Sep 17 00:00:00 2001 From: Coly Li Date: Mon, 30 Jun 2008 18:45:45 +0800 Subject: [PATCH] --- yaml --- r: 102344 b: refs/heads/master c: c0420ad2ca514551ca086510b0e7d17a05c70492 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/aops.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index dfddb80c1ffe..4f5e6d497a35 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e75206517504461778c283b942440ef312e437d5 +refs/heads/master: c0420ad2ca514551ca086510b0e7d17a05c70492 diff --git a/trunk/fs/ocfs2/aops.c b/trunk/fs/ocfs2/aops.c index 17964c0505a9..1db080135c6d 100644 --- a/trunk/fs/ocfs2/aops.c +++ b/trunk/fs/ocfs2/aops.c @@ -174,10 +174,17 @@ static int ocfs2_get_block(struct inode *inode, sector_t iblock, * need to use BH_New is when we're extending i_size on a file * system which doesn't support holes, in which case BH_New * allows block_prepare_write() to zero. + * + * If we see this on a sparse file system, then a truncate has + * raced us and removed the cluster. In this case, we clear + * the buffers dirty and uptodate bits and let the buffer code + * ignore it as a hole. */ - mlog_bug_on_msg(create && p_blkno == 0 && ocfs2_sparse_alloc(osb), - "ino %lu, iblock %llu\n", inode->i_ino, - (unsigned long long)iblock); + if (create && p_blkno == 0 && ocfs2_sparse_alloc(osb)) { + clear_buffer_dirty(bh_result); + clear_buffer_uptodate(bh_result); + goto bail; + } /* Treat the unwritten extent as a hole for zeroing purposes. */ if (p_blkno && !(ext_flags & OCFS2_EXT_UNWRITTEN))