kernel/ufs: Fix mount_point access in ffs_blkfree() when using softdep.
authorSascha Wildner <saw@online.de>
Mon, 10 Oct 2011 20:42:55 +0000 (22:42 +0200)
committerSascha Wildner <saw@online.de>
Mon, 10 Oct 2011 20:42:55 +0000 (22:42 +0200)
Was going through inode->vnode->v_mount, but vnode was bad so
v_mount was NULL reference.

New way to get mount point: inode->i_devvp->v_mount.

Reported-by: Thomas Nikolajsen
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2142>
Submitted-by: Tim Bisson <bissont@mac.com>
sys/vfs/ufs/ffs_alloc.c

index 7ee59c4..a3eb225 100644 (file)
@@ -1658,10 +1658,10 @@ ffs_blkfree_trim_completed(struct bio *biop)
 void
 ffs_blkfree(struct inode *ip, ufs_daddr_t bno, long size) 
 {
-       struct ufsmount *ump = VFSTOUFS(ITOV(ip)->v_mount);;
+       struct mount *mp = ip->i_devvp->v_mount;
        struct ffs_blkfree_trim_params *tp;
 
-       if (!(ump->um_mountp->mnt_flag & MNT_TRIM)) {
+       if (!(mp->mnt_flag & MNT_TRIM)) {
                ffs_blkfree_cg(ip->i_fs, ip->i_devvp,ip->i_dev,ip->i_number,
                    ip->i_uid, bno, size);
                return;