hammer: hammer_recover_stage2() may only be called for read-write mounts
authorThomas Nikolajsen <thomas@dragonflybsd.org>
Wed, 11 Nov 2009 17:56:47 +0000 (18:56 +0100)
committerThomas Nikolajsen <thomas@dragonflybsd.org>
Sat, 14 Nov 2009 16:10:29 +0000 (17:10 +0100)
This fixes panic doing readonly mount.

sys/vfs/hammer/hammer_vfsops.c

index 757a398..fa478bf 100644 (file)
@@ -659,7 +659,8 @@ hammer_vfs_mount(struct mount *mp, char *mntpt, caddr_t data,
                goto done;
        vput(rootvp);
        /*vn_unlock(hmp->rootvp);*/
-       error = hammer_recover_stage2(hmp, rootvol);
+       if (hmp->ronly == 0)
+               error = hammer_recover_stage2(hmp, rootvol);
 
 done:
        hammer_rel_volume(rootvol, 0);