Whamcloud - gitweb
Found one bug; testing for list_empty(slist) is ok, but you
authorbraam <braam>
Sat, 22 Jan 2000 03:56:23 +0000 (03:56 +0000)
committerbraam <braam>
Sat, 22 Jan 2000 03:56:23 +0000 (03:56 +0000)
must initialize this list head after deleting it form the list.

lustre/obdfs/flushd.c
lustre/obdfs/rw.c

index 39e0679..92f366f 100644 (file)
@@ -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)
 {
index 1bdbf9e..06e7d5a 100644 (file)
@@ -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;