Re: [PATCH] ReiserFS: Make sure all dentries refs are released before calling kill_block_super()

David Howells
2006-08-09T11:00:53Z

Rafael J. Wysocki <rjw@sisk.pl> wrote:

> It didn't apply cleanly to -rc3-mm2 for me and produces the appended oops
> every time at the kernel startup (on x86_64).

Hmmm... It works okay for me, but then I'm testing it on i686, not x86_64.
Should I draw any meaning from you saying "(on x86_64)"?

Also, can you do:

gdb vmlinux

And then at the prompt, can you disassemble the reiserfs_kill_sb() function:

disas reiserfs_kill_sb

And send me the disassembly?

If I had to guess, I'd say that REISERFS_SB() returned a NULL pointer, and
that sb->s_root is NULL. In which case generic_shutdown_super() will not
invoke reiserfs_put_super().

Something that you can try is to modify reiserfs_kill_sb() to be:

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);
}

That way the function will be able to kill a superblock that isn't fully
initialised.

David