From: Joe Talbott Date: Tue, 7 Sep 2010 04:17:00 +0000 (-0400) Subject: msdosfs - Fix panic when mounting msdos filesystems. X-Git-Url: https://gitweb.dragonflybsd.org/~lentferj/dragonfly.git/commitdiff_plain/12d442975420e1da3daae44f5c20a3c1dce055df msdosfs - Fix panic when mounting msdos filesystems. bread()ing different sizes from the same address requires this flag before b[q]relse() is called. Discussed-With: dillon --- diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index f7abfc6929..743279d23e 100644 --- a/sys/vfs/msdosfs/msdosfs_vfsops.c +++ b/sys/vfs/msdosfs/msdosfs_vfsops.c @@ -522,6 +522,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct msdosfs_args *argp) /* * Release the bootsector buffer. */ + bp->b_flags |= B_RELBUF; brelse(bp); bp = NULL; @@ -543,6 +544,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct msdosfs_args *argp) pmp->pm_nxtfree = CLUST_FIRST; } else pmp->pm_fsinfo = 0; + bp->b_flags |= B_RELBUF; brelse(bp); bp = NULL; } @@ -605,8 +607,10 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct msdosfs_args *argp) return 0; error_exit: - if (bp) + if (bp) { + bp->b_flags |= B_RELBUF; brelse(bp); + } VOP_CLOSE(devvp, ronly ? FREAD : FREAD | FWRITE); if (pmp) { if (pmp->pm_inusemap)