On Thu, 2005-02-10 at 15:12, Stephen C. Tweedie wrote:
> Hi,
> 
> On Thu, 2005-02-10 at 20:21, Andrew Morton wrote:
> 
> > > But I still don't understand why this can't happen
> > >  thro original code ..
> 
> > >  what am i missing ?
> > 
> > presumably there are never any dirty pages or inodes when we run
> > journal_destroy().
> 
> I assume so, yes.  If there is no a_ops->writepages(), then we default
> to generic_writepages() which is a noop if there are no dirty pages.  If
> your new ext3-specific writepages code tries to do a journal_start() in
> that case, then yes, it is likely to blow up spectacularly during
> journal_destroy!
> 
> --Stephen

Yep. I found this hardway that exactly whats happening.
generic_writepages() is clever enough to do nothing, if there are no
dirty pages. But I am being stupid in my writepages(). 

I need to teach writepages() to nothing in case of no dirty pages. 
Is there a easy way like checking a count somewhere than doing all the
stuff mpage_writepages() is doing to figure this out, like ..


        while (!done && (index <= end) &&
                        (nr_pages = pagevec_lookup_tag(&pvec, mapping,
&index,
                        PAGECACHE_TAG_DIRTY,
                        min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1)))
        ...

Thanks,
Badari

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to