aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2005-10-03 16:32:11 -0400
committerDave Kleikamp <shaggy@austin.ibm.com>2005-10-03 16:32:11 -0400
commitac17b8b57013a3e38d1958f66a218f15659e5752 (patch)
treef7a28ccd5bd5496f6a2284f3d77a5019dc75c820
parentddea7be0ec8d1374f0b483a81566ed56ec9f3905 (diff)
JFS: make special inodes play nicely with page balancing
This patch fixes up a few problems with jfs's reserved inodes. 1. There is no need for the jfs code setting the I_DIRTY bits in i_state. I am ashamed that the code ever did this, and surprised it hasn't been noticed until now. 2. Make sure special inodes are on an inode hash list. If the inodes are unhashed, __mark_inode_dirty will fail to put the inode on the superblock's dirty list, and the data will not be flushed under memory pressure. 3. Force writing journal data to disk when metapage_writepage is unable to write a metadata page due to pending journal I/O. Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
-rw-r--r--fs/jfs/jfs_dmap.c1
-rw-r--r--fs/jfs/jfs_imap.c10
-rw-r--r--fs/jfs/jfs_metapage.c6
-rw-r--r--fs/jfs/jfs_txnmgr.c2
-rw-r--r--fs/jfs/super.c1
5 files changed, 15 insertions, 5 deletions
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index eadf319bee22..51c02bf07878 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -305,7 +305,6 @@ int dbSync(struct inode *ipbmap)
305 filemap_fdatawrite(ipbmap->i_mapping); 305 filemap_fdatawrite(ipbmap->i_mapping);
306 filemap_fdatawait(ipbmap->i_mapping); 306 filemap_fdatawait(ipbmap->i_mapping);
307 307
308 ipbmap->i_state |= I_DIRTY;
309 diWriteSpecial(ipbmap, 0); 308 diWriteSpecial(ipbmap, 0);
310 309
311 return (0); 310 return (0);
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index 4021d46da7e3..28201b194f53 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -57,6 +57,12 @@
57#include "jfs_debug.h" 57#include "jfs_debug.h"
58 58
59/* 59/*
60 * __mark_inode_dirty expects inodes to be hashed. Since we don't want
61 * special inodes in the fileset inode space, we hash them to a dummy head
62 */
63static HLIST_HEAD(aggregate_hash);
64
65/*
60 * imap locks 66 * imap locks
61 */ 67 */
62/* iag free list lock */ 68/* iag free list lock */
@@ -491,6 +497,8 @@ struct inode *diReadSpecial(struct super_block *sb, ino_t inum, int secondary)
491 /* release the page */ 497 /* release the page */
492 release_metapage(mp); 498 release_metapage(mp);
493 499
500 hlist_add_head(&ip->i_hash, &aggregate_hash);
501
494 return (ip); 502 return (ip);
495} 503}
496 504
@@ -514,8 +522,6 @@ void diWriteSpecial(struct inode *ip, int secondary)
514 ino_t inum = ip->i_ino; 522 ino_t inum = ip->i_ino;
515 struct metapage *mp; 523 struct metapage *mp;
516 524
517 ip->i_state &= ~I_DIRTY;
518
519 if (secondary) 525 if (secondary)
520 address = addressPXD(&sbi->ait2) >> sbi->l2nbperpage; 526 address = addressPXD(&sbi->ait2) >> sbi->l2nbperpage;
521 else 527 else
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 13d7e3f1feb4..c81c6438fce5 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -395,6 +395,12 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
395 395
396 if (mp->nohomeok && !test_bit(META_forcewrite, &mp->flag)) { 396 if (mp->nohomeok && !test_bit(META_forcewrite, &mp->flag)) {
397 redirty = 1; 397 redirty = 1;
398 /*
399 * Make sure this page isn't blocked indefinitely.
400 * If the journal isn't undergoing I/O, push it
401 */
402 if (mp->log && !(mp->log->cflag & logGC_PAGEOUT))
403 jfs_flush_journal(mp->log, 0);
398 continue; 404 continue;
399 } 405 }
400 406
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 9b71ed2674fe..b660c93c92de 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -2396,7 +2396,6 @@ static void txUpdateMap(struct tblock * tblk)
2396 */ 2396 */
2397 if (tblk->xflag & COMMIT_CREATE) { 2397 if (tblk->xflag & COMMIT_CREATE) {
2398 diUpdatePMap(ipimap, tblk->ino, FALSE, tblk); 2398 diUpdatePMap(ipimap, tblk->ino, FALSE, tblk);
2399 ipimap->i_state |= I_DIRTY;
2400 /* update persistent block allocation map 2399 /* update persistent block allocation map
2401 * for the allocation of inode extent; 2400 * for the allocation of inode extent;
2402 */ 2401 */
@@ -2407,7 +2406,6 @@ static void txUpdateMap(struct tblock * tblk)
2407 } else if (tblk->xflag & COMMIT_DELETE) { 2406 } else if (tblk->xflag & COMMIT_DELETE) {
2408 ip = tblk->u.ip; 2407 ip = tblk->u.ip;
2409 diUpdatePMap(ipimap, ip->i_ino, TRUE, tblk); 2408 diUpdatePMap(ipimap, ip->i_ino, TRUE, tblk);
2410 ipimap->i_state |= I_DIRTY;
2411 iput(ip); 2409 iput(ip);
2412 } 2410 }
2413} 2411}
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 71bc34b96b2b..4226af3ea91b 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -442,6 +442,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
442 inode->i_nlink = 1; 442 inode->i_nlink = 1;
443 inode->i_size = sb->s_bdev->bd_inode->i_size; 443 inode->i_size = sb->s_bdev->bd_inode->i_size;
444 inode->i_mapping->a_ops = &jfs_metapage_aops; 444 inode->i_mapping->a_ops = &jfs_metapage_aops;
445 insert_inode_hash(inode);
445 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); 446 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
446 447
447 sbi->direct_inode = inode; 448 sbi->direct_inode = inode;