Message ID | 1244095805-17015-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com |
---|---|
State | Deferred |
Headers | show |
On Thu, Jun 04, 2009 at 11:40:05AM +0530, Aneesh Kumar K.V wrote: > Now we have block_lock_hole_extend clearing the dirty flag of > buffer_heads outside i_size we should not find buffer_heads > which are unmapped and dirty in writepage. If we find do a WARN_ON. > We can still continue because block_write_full page look at the mapped > flag only. This is only true only *after* Jan's patches are applied, right? So that means it's only safe to apply this after Jan's patch series is applied. So I believe I need to queue this in the unstable portion of the patch queue until the page_mkwrite() changes are applied; otherwise we could have some spurious WARN_ON's. - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2219daa..9bba474 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2488,6 +2488,10 @@ static int __ext4_journalled_writepage(struct page *page, return ret; } +static int ext4_bh_unmapped_and_dirty(handle_t *handle, struct buffer_head *bh) +{ + return !buffer_mapped(bh) && buffer_dirty(bh); +} /* * Note that we don't need to start a transaction unless we're journaling data @@ -2602,6 +2606,14 @@ static int ext4_writepage(struct page *page, /* now mark the buffer_heads as dirty and uptodate */ block_commit_write(page, 0, len); } + /* + * There should not be any unmapped and dirty + * buffer_heads at this point. Look at block_lock_hole_extend + * for more info. If we find one print more info + */ + WARN(walk_page_buffers(NULL, page_bufs, 0, len, NULL, + ext4_bh_unmapped_and_dirty), + "Unmapped dirty buffer_heads found in %s\n", __func__); if (PageChecked(page) && ext4_should_journal_data(inode)) { /*