From 34467a74874be852e48ab9a71901468d5c180cad Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 29 Feb 2000 23:54:52 +0000 Subject: [PATCH] obdfs/dir.c: fix bug when reading directories > 4096 bytes obdfs/flushd.c: handle I/O error by putting bad inode to end of list --- lustre/obdfs/dir.c | 2 +- lustre/obdfs/flushd.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lustre/obdfs/dir.c b/lustre/obdfs/dir.c index 7c8f96a..1aa3d66 100644 --- a/lustre/obdfs/dir.c +++ b/lustre/obdfs/dir.c @@ -143,7 +143,7 @@ static int obdfs_readdir(struct file * filp, void * dirent, filldir_t filldir) OIDEBUG(inode); while (!error && !stored && filp->f_pos < inode->i_size) { - page = obdfs_getpage(inode, offset, 0, LOCKED); + page = obdfs_getpage(inode, filp->f_pos, 0, LOCKED); PDEBUG(page, "readdir"); if (!page) { ext2_error (sb, "ext2_readdir", diff --git a/lustre/obdfs/flushd.c b/lustre/obdfs/flushd.c index 52d7bd7..0bcf10c 100644 --- a/lustre/obdfs/flushd.c +++ b/lustre/obdfs/flushd.c @@ -47,8 +47,7 @@ struct { int interval; /* jiffies delay between pupdate flushes */ int age_buffer; /* Time for normal buffer to age before we flush it */ int age_super; /* Time for superblock to age before we flush it */ -/* } pupd_prm = {40, 500, 64, 256, 2*HZ, 30*HZ, 5*HZ }; */ -} pupd_prm = {40, 500, 64, 256, 10*HZ, 30*HZ, 5*HZ }; +} pupd_prm = {40, 500, 64, 256, 3*HZ, 30*HZ, 5*HZ }; /* Called with the superblock list lock */ static int obdfs_enqueue_pages(struct inode *inode, struct obdo **obdo, @@ -74,7 +73,7 @@ static int obdfs_enqueue_pages(struct inode *inode, struct obdo **obdo, if (check_time && (jiffies - req->rq_jiffies) < pupd_prm.age_buffer) - continue; /* FIXME break; (pages are in order) */ + break; /* pages are in chronological order */ /* Only allocate the obdo if we will actually do I/O here */ if ( !*obdo ) { @@ -187,6 +186,15 @@ int obdfs_flush_reqs(struct list_head *inode_list, int check_time) CDEBUG(D_CACHE, "FLUSH inode %ld, pages flushed: %d\n", inode->i_ino, res); if ( res < 0 ) { + CDEBUG(D_INODE, + "fatal: unable to enqueue inode %ld (err %d)\n", + inode->i_ino, err); + /* XXX Move bad inode to end of list so we can + * continue with flushing list. This is a + * temporary measure to avoid machine lockups. + */ + list_del(tmp); + list_add(tmp, inode_list); err = res; EXIT; goto BREAK; @@ -204,6 +212,8 @@ int obdfs_flush_reqs(struct list_head *inode_list, int check_time) pages, bufs, counts, offsets, flags); if ( err ) { + CDEBUG(D_INODE, + "fatal: unable to do vec_wr (err %d)\n", err); EXIT; goto ERR; } @@ -221,6 +231,8 @@ BREAK: err = obdfs_do_vec_wr(inodes, num_io, num_obdos, obdos, bufs_per_obdo, pages, bufs, counts, offsets, flags); + if (err) + CDEBUG(D_INODE, "fatal: unable to do vec_wr (err %d)\n", err); num_io = 0; num_obdos = 0; } -- 1.8.3.1