diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-05-24 08:43:38 -0400 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-05-24 08:43:38 -0400 |
commit | b964638ffd59b61c13f02b81e5118a6e573d91cd (patch) | |
tree | 118ab6ba3bceab3ab39d7d22070d03af2ace6f18 /fs | |
parent | 387e2b0439026aa738a9edca15a57e5c0bcb4dfc (diff) |
JFS: Fix multiple errors in metapage_releasepage
It looks like metapage_releasepage was making in invalid assumption that
the releasepage method would not be called on a dirty page. Instead of
issuing a warning and releasing the metapage, it should return 0, indicating
that the private data for the page cannot be released.
I also realized that metapage_releasepage had the return code all wrong. If
it is successful in releasing the private data, it should return 1, otherwise
it needs to return 0.
Lastly, there is no need to call wait_on_page_writeback, since
try_to_release_page will not call us with a page in writback state.
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jfs/jfs_metapage.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index f28696f235c..2b220dd6b4e 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c | |||
@@ -542,7 +542,7 @@ add_failed: | |||
542 | static int metapage_releasepage(struct page *page, gfp_t gfp_mask) | 542 | static int metapage_releasepage(struct page *page, gfp_t gfp_mask) |
543 | { | 543 | { |
544 | struct metapage *mp; | 544 | struct metapage *mp; |
545 | int busy = 0; | 545 | int ret = 1; |
546 | unsigned int offset; | 546 | unsigned int offset; |
547 | 547 | ||
548 | for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { | 548 | for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { |
@@ -552,30 +552,20 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask) | |||
552 | continue; | 552 | continue; |
553 | 553 | ||
554 | jfs_info("metapage_releasepage: mp = 0x%p", mp); | 554 | jfs_info("metapage_releasepage: mp = 0x%p", mp); |
555 | if (mp->count || mp->nohomeok) { | 555 | if (mp->count || mp->nohomeok || |
556 | test_bit(META_dirty, &mp->flag)) { | ||
556 | jfs_info("count = %ld, nohomeok = %d", mp->count, | 557 | jfs_info("count = %ld, nohomeok = %d", mp->count, |
557 | mp->nohomeok); | 558 | mp->nohomeok); |
558 | busy = 1; | 559 | ret = 0; |
559 | continue; | 560 | continue; |
560 | } | 561 | } |
561 | wait_on_page_writeback(page); | ||
562 | //WARN_ON(test_bit(META_dirty, &mp->flag)); | ||
563 | if (test_bit(META_dirty, &mp->flag)) { | ||
564 | dump_mem("dirty mp in metapage_releasepage", mp, | ||
565 | sizeof(struct metapage)); | ||
566 | dump_mem("page", page, sizeof(struct page)); | ||
567 | dump_stack(); | ||
568 | } | ||
569 | if (mp->lsn) | 562 | if (mp->lsn) |
570 | remove_from_logsync(mp); | 563 | remove_from_logsync(mp); |
571 | remove_metapage(page, mp); | 564 | remove_metapage(page, mp); |
572 | INCREMENT(mpStat.pagefree); | 565 | INCREMENT(mpStat.pagefree); |
573 | free_metapage(mp); | 566 | free_metapage(mp); |
574 | } | 567 | } |
575 | if (busy) | 568 | return ret; |
576 | return -1; | ||
577 | |||
578 | return 0; | ||
579 | } | 569 | } |
580 | 570 | ||
581 | static void metapage_invalidatepage(struct page *page, unsigned long offset) | 571 | static void metapage_invalidatepage(struct page *page, unsigned long offset) |