From 248b899a1449b4d23ba1b20fea95960b1d3fc800 Mon Sep 17 00:00:00 2001 From: braam Date: Sat, 22 Jan 2000 03:56:23 +0000 Subject: [PATCH] Found one bug; testing for list_empty(slist) is ok, but you must initialize this list head after deleting it form the list. --- lustre/obdfs/flushd.c | 5 ++++- lustre/obdfs/rw.c | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lustre/obdfs/flushd.c b/lustre/obdfs/flushd.c index 39e0679..92f366f 100644 --- a/lustre/obdfs/flushd.c +++ b/lustre/obdfs/flushd.c @@ -61,8 +61,11 @@ static int obdfs_enqueue_pages(struct inode *inode, struct obdo **obdo, int i = 0; ENTRY; + /* if there are no pages, remove from super block list */ if (list_empty(obdfs_iplist(inode))) { list_del(obdfs_islist(inode)); + /* we check for "empty" on this animal: must init it! */ + INIT_LIST_HEAD(obdfs_islist(inode)); CDEBUG(D_INODE, "empty list\n"); EXIT; return 0; @@ -114,7 +117,7 @@ static int obdfs_enqueue_pages(struct inode *inode, struct obdo **obdo, } -/* Remove writeback requests from an inode */ +/* Remove writeback requests for the superblock */ int obdfs_flush_reqs(struct list_head *inode_list, int flush_inode, int check_time) { diff --git a/lustre/obdfs/rw.c b/lustre/obdfs/rw.c index 1bdbf9e..06e7d5a 100644 --- a/lustre/obdfs/rw.c +++ b/lustre/obdfs/rw.c @@ -185,9 +185,11 @@ int obdfs_do_vec_wr(struct super_block *sb, obd_count num_io, err = OPS(sb, brw)(WRITE, &sbi->osi_conn, num_obdos, obdos, oa_bufs, bufs, counts, offsets, flags); - do { - put_page(pages[--num_io]); - } while ( num_io > 0 ); + /* release the pages from the page cache */ + while ( num_io >= 0 ) { + num_io--; + put_page(pages[num_io]); + } EXIT; return err; -- 1.8.3.1