On Fri, Feb 22, 2008 at 08:01:28PM +0530, Aneesh Kumar K.V wrote: > > > + > > > + /* Now write all the buffer_heads in the page */ > > > + do { > > > + set_buffer_uptodate(bh); > > > + if (ext4_should_journal_data(inode)) { > > > + err = ext4_journal_get_write_access(handle, bh); > > > + /* do we have that many credits ??*/ > > > + if (err) > > > + goto err_out; > > > + } > > > + zero_user(page, offset, blocksize); > > > > Ah oh, you are trying to zero out the pages in the page cache, that's > > seems wrong to me. By the time get_block() is called from writepages(), > > the pages should have meaningful content that needs to flush to disk, > > zero the pages out will lost the data. > > > > It is writebegin. In case of writebegin the pages doesn't have the content. By the > time we reach write begin the page is supposed to have buffer heads that > are alreayd mapped. So we won't end up calling get_blk. Even in case of > mmap with page_mkwrite change we would have called writebegin equivalent > before the writepage. I guess the above para is confusing. The callback is actually writebegin.In case of writebegin the page doesn't have the content. With respect to writepage by the time we call the callback the buffer_heads related to the page would already be mapped. So we won't end up calling get_blk. -aneesh - To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html