NetBSD-Bugs archive

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

Re: kern/45607: mount_nilfs(8) on wedge panic



The following reply was made to PR kern/45607; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: gregoire.sutre%gmail.com@localhost
Subject: Re: kern/45607: mount_nilfs(8) on wedge panic
Date: Sun, 13 Nov 2011 17:29:02 +0000

 On Sat, Nov 12, 2011 at 03:35:00PM +0000, gregoire.sutre%gmail.com@localhost 
wrote:
  > The patch below fixes the problem.  But mount_nilfs(8) still does not
  > work on wedges.  The patch only fixes the panic.
 
 The following completely untested patch (applied after yours) may make
 it work, or at least get farther.
 
 Index: nilfs_vfsops.c
 ===================================================================
 RCS file: /cvsroot/src/sys/fs/nilfs/nilfs_vfsops.c,v
 retrieving revision 1.6
 diff -u -r1.6 nilfs_vfsops.c
 --- nilfs_vfsops.c     13 Nov 2011 17:22:51 -0000      1.6
 +++ nilfs_vfsops.c     13 Nov 2011 17:26:59 -0000
 @@ -563,10 +563,11 @@
  nilfs_mount_device(struct vnode *devvp, struct mount *mp, struct nilfs_args 
*args,
        struct nilfs_device **nilfsdev_p)
  {
 -      struct partinfo dpart;
        struct nilfs_device *nilfsdev;
        struct lwp *l = curlwp;
        int openflags, accessmode, error;
 +      uint64_t numblocks;
 +      unsigned blocksize;
  
        DPRINTF(VOLUMES, ("Mounting NILFS device\n"));
  
 @@ -639,13 +640,13 @@
        SLIST_INSERT_HEAD(&nilfs_devices, nilfsdev, next_device);
  
        /* get our device's size */
 -      error = VOP_IOCTL(devvp, DIOCGPART, &dpart, FREAD, NOCRED);
 +      error = getdisksize(devvp, DIOCGPART, &numblocks, &blocksize);
        if (error) {
                /* remove all our information */
                nilfs_unmount_device(nilfsdev);
                return EINVAL;
        }
 -      nilfsdev->devsize = dpart.part->p_size * dpart.disklab->d_secsize;
 +      nilfsdev->devsize = numblocks * blocksize;
  
        /* connect to the head for most recent files XXX really pass mp and 
args? */
        error = nilfs_mount_base(nilfsdev, mp, args);
 
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index