tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: panic: ffs_snapshot_mount: already on list



This will damage all persistent snapshots if you boot a kernel with FFS_NO_SNAPSHOT
Pleas don't commit ...

> On 13. Sep 2018, at 08:08, Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
> 
> Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
> 
>> maybe clear fs->fs_snapinum[snaploc] in that case ?
> 
> I am about to commit the patch below, but the problem 
> is: I cannot test it, since I cleaned up the obsolete snapshot 
> storage backend file from the machine I had the initial
> problem with.
> 
> Index: sys/ufs/ffs/ffs_snapshot.c
> ===================================================================
> RCS file: /cvsroot/src/sys/ufs/ffs/ffs_snapshot.c,v
> retrieving revision 1.149
> diff -U4 -r1.149 ffs_snapshot.c
> --- sys/ufs/ffs/ffs_snapshot.c  1 Jun 2017 02:45:15 -0000       1.149
> +++ sys/ufs/ffs/ffs_snapshot.c  13 Sep 2018 06:03:32 -0000
> @@ -1734,8 +1734,9 @@
>  */
> void
> ffs_snapshot_mount(struct mount *mp)
> {
> +#ifndef FFS_NO_SNAPSHOT
>        struct vnode *devvp = VFSTOUFS(mp)->um_devvp;
>        struct fs *fs = VFSTOUFS(mp)->um_fs;
>        struct lwp *l = curlwp;
>        struct vnode *vp;
> @@ -1823,14 +1824,16 @@
> 
>                /*
>                 * Link it onto the active snapshot list.
>                 */
> -               if (is_active_snapshot(si, ip))
> -                       panic("ffs_snapshot_mount: %"PRIu64" already on list",
> +               if (is_active_snapshot(si, ip)) {
> +                       printf("ffs_snapshot_mount: %"PRIu64" already on list",
>                            ip->i_number);
> -               else
> +                       fs->fs_snapinum[snaploc] = 0;
> +               } else {
>                        TAILQ_INSERT_TAIL(&si->si_snapshots, ip, i_nextsnap);
> -               vp->v_vflag |= VV_SYSTEM;
> +                       vp->v_vflag |= VV_SYSTEM;
> +               }
>                VOP_UNLOCK(vp);
>        }
>        /*
>         * No usable snapshots found.
> @@ -1847,8 +1850,9 @@
>        si->si_snapblklist = xp->i_snapblklist;
>        fscow_establish(mp, ffs_copyonwrite, devvp);
>        si->si_gen++;
>        mutex_exit(&si->si_lock);
> +#endif /* FFS_NO_SNAPSHOT */
> }
> 
> /*
>  * Disassociate snapshot files when unmounting.
> 
> 
> 
> -- 
> Emmanuel Dreyfus
> http://hcpnet.free.fr/pubz
> manu%netbsd.org@localhost

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)



Home | Main Index | Thread Index | Old Index