Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/nilfs Avoid panic on error path, from PR 45607. The e...



details:   https://anonhg.NetBSD.org/src/rev/aaacc7b506f8
branches:  trunk
changeset: 771180:aaacc7b506f8
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Nov 13 17:22:51 2011 +0000

description:
Avoid panic on error path, from PR 45607. The error path is exercised
because this is using DIOCGPART to get the volume size, which doesn't
work on wedges. It should be calling getdisksize() instead.

diffstat:

 sys/fs/nilfs/nilfs_vfsops.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 2390085e53da -r aaacc7b506f8 sys/fs/nilfs/nilfs_vfsops.c
--- a/sys/fs/nilfs/nilfs_vfsops.c       Sun Nov 13 17:00:04 2011 +0000
+++ b/sys/fs/nilfs/nilfs_vfsops.c       Sun Nov 13 17:22:51 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vfsops.c,v 1.5 2010/08/11 13:26:25 pgoyette Exp $ */
+/* $NetBSD: nilfs_vfsops.c,v 1.6 2011/11/13 17:22:51 dholland Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_vfsops.c,v 1.5 2010/08/11 13:26:25 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_vfsops.c,v 1.6 2011/11/13 17:22:51 dholland Exp $");
 #endif /* not lint */
 
 
@@ -635,6 +635,9 @@
        cv_init(&nilfsdev->sync_cv, "nilfssyn");
        STAILQ_INIT(&nilfsdev->mounts);
 
+       /* register nilfs_device in list */
+       SLIST_INSERT_HEAD(&nilfs_devices, nilfsdev, next_device);
+
        /* get our device's size */
        error = VOP_IOCTL(devvp, DIOCGPART, &dpart, FREAD, NOCRED);
        if (error) {
@@ -644,9 +647,6 @@
        }
        nilfsdev->devsize = dpart.part->p_size * dpart.disklab->d_secsize;
 
-       /* register nilfs_device in list */
-       SLIST_INSERT_HEAD(&nilfs_devices, nilfsdev, next_device);
-
        /* connect to the head for most recent files XXX really pass mp and args? */
        error = nilfs_mount_base(nilfsdev, mp, args);
        if (error) {



Home | Main Index | Thread Index | Old Index