From c579cab9cbed03cdb4a9330dde81639679761a69 Mon Sep 17 00:00:00 2001 From: gord-fig Date: Thu, 18 Oct 2001 22:11:07 +0000 Subject: [PATCH] Add code to help debug the rmmod hang. --- lustre/obdfs/flushd.c | 14 ++++++++++++++ lustre/obdfs/super.c | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lustre/obdfs/flushd.c b/lustre/obdfs/flushd.c index 2458720..88245b2 100644 --- a/lustre/obdfs/flushd.c +++ b/lustre/obdfs/flushd.c @@ -127,10 +127,13 @@ void obdfs_dequeue_pages(struct inode *inode) struct list_head *tmp; ENTRY; + printk ("down0\n"); obd_down(&obdfs_i2sbi(inode)->osi_list_mutex); + printk ("got down0\n"); tmp = obdfs_islist(inode); if ( list_empty(tmp) ) { CDEBUG(D_INFO, "no dirty pages for inode %ld\n", inode->i_ino); + printk ("up 0a"); obd_up(&obdfs_i2sbi(inode)->osi_list_mutex); EXIT; return; @@ -153,6 +156,7 @@ void obdfs_dequeue_pages(struct inode *inode) put_page(page); } + printk ("up 0b"); obd_up(&obdfs_i2sbi(inode)->osi_list_mutex); /* decrement inode reference for page cache */ @@ -187,9 +191,12 @@ int obdfs_flush_reqs(struct list_head *inode_list, unsigned long check_time) sbi = list_entry(inode_list, struct obdfs_sb_info, osi_inodes); + printk ("down1\n"); obd_down(&sbi->osi_list_mutex); + printk ("got down1\n"); if ( list_empty(inode_list) ) { CDEBUG(D_INFO, "list empty\n"); + printk ("up 1a\n"); obd_up(&sbi->osi_list_mutex); EXIT; return 0; @@ -254,6 +261,7 @@ int obdfs_flush_reqs(struct list_head *inode_list, unsigned long check_time) num_obdos++; if ( num_io == MAX_IOVEC ) { + printk ("up 1b\n"); obd_up(&sbi->osi_list_mutex); err = obdfs_do_vec_wr(inodes, num_io, num_obdos, obdos, bufs_per_obdo, @@ -266,13 +274,16 @@ int obdfs_flush_reqs(struct list_head *inode_list, unsigned long check_time) EXIT; goto ERR; } + printk ("down2\n"); obd_down(&sbi->osi_list_mutex); + printk ("got down2\n"); goto again; } } } BREAK: + printk ("up 2\n"); obd_up(&sbi->osi_list_mutex); /* flush any remaining I/Os */ @@ -290,7 +301,9 @@ BREAK: * Make sure we don't point at the current inode with tmp * when we re-init the list on the inode, or we will loop. */ + printk ("down3\n"); obd_down(&sbi->osi_list_mutex); + printk ("got down3\n"); tmp = inode_list; while ( (tmp = tmp->prev) != inode_list ) { struct obdfs_inode_info *ii; @@ -309,6 +322,7 @@ BREAK: INIT_LIST_HEAD(obdfs_islist(inode)); } } + printk ("up 3\n"); obd_up(&sbi->osi_list_mutex); CDEBUG(D_INFO, "flushed %ld pages in total\n", total_io); diff --git a/lustre/obdfs/super.c b/lustre/obdfs/super.c index 9af4896..5f97dcc 100644 --- a/lustre/obdfs/super.c +++ b/lustre/obdfs/super.c @@ -192,7 +192,7 @@ static struct super_block * obdfs_read_super(struct super_block *sb, CDEBUG(D_INFO, "\n"); /* list of dirty inodes, and a mutex to hold while modifying it */ INIT_LIST_HEAD(&sbi->osi_inodes); - sema_init(&sbi->osi_list_mutex, 1); + init_MUTEX (&sbi->osi_list_mutex); CDEBUG(D_INFO, "\n"); sbi->osi_super = sb; @@ -286,7 +286,6 @@ static void obdfs_put_super(struct super_block *sb) OPS(sb,disconnect)(ID(sb)); list_del(&sbi->osi_list); - memset(sbi, 0, sizeof(*sbi)); printk(KERN_INFO "OBDFS: Bye bye.\n"); -- 1.8.3.1