Variant of ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc3/2.6.18-rc3-mm2/hot-fixes/reiserfs-make-sure-all-dentries-refs-are-released-before-calling-kill_block_super-try-2.patch --- linux-2.6.18.noarch/fs/reiserfs/super.c~ 2006-09-21 17:06:45.642412000 -0400 +++ linux-2.6.18.noarch/fs/reiserfs/super.c 2006-09-21 17:09:02.232689000 -0400 @@ -430,22 +430,29 @@ int remove_save_link(struct inode *inode return journal_end(&th, inode->i_sb, JOURNAL_PER_BALANCE_CNT); } +static void reiserfs_kill_sb(struct super_block *s) +{ + if (REISERFS_SB(s)) { + if (REISERFS_SB(s)->xattr_root) { + d_invalidate(REISERFS_SB(s)->xattr_root); + dput(REISERFS_SB(s)->xattr_root); + REISERFS_SB(s)->xattr_root = NULL; + } + if (REISERFS_SB(s)->priv_root) { + d_invalidate(REISERFS_SB(s)->priv_root); + dput(REISERFS_SB(s)->priv_root); + REISERFS_SB(s)->priv_root = NULL; + } + kill_block_super(s); + } +} + static void reiserfs_put_super(struct super_block *s) { int i; struct reiserfs_transaction_handle th; th.t_trans_id = 0; - if (REISERFS_SB(s)->xattr_root) { - d_invalidate(REISERFS_SB(s)->xattr_root); - dput(REISERFS_SB(s)->xattr_root); - } - - if (REISERFS_SB(s)->priv_root) { - d_invalidate(REISERFS_SB(s)->priv_root); - dput(REISERFS_SB(s)->priv_root); - } - /* change file system state to current state if it was mounted with read-write permissions */ if (!(s->s_flags & MS_RDONLY)) { if (!journal_begin(&th, s, 10)) { @@ -2300,7 +2307,7 @@ struct file_system_type reiserfs_fs_type .owner = THIS_MODULE, .name = "reiserfs", .get_sb = get_super_block, - .kill_sb = kill_block_super, + .kill_sb = reiserfs_kill_sb, .fs_flags = FS_REQUIRES_DEV, };