Date: Sun, 17 May 1998 14:24:28 +0200 (MET DST) From: Ugo Paternostro <paterno@dsi.UNIFI.IT> To: Hideki Yamamoto <hyama@acm.org> Cc: freebsd-stable@FreeBSD.ORG Subject: Re: mount_msdos and msdosfs for VFAT/FAT32 access Message-ID: <XFMail.980517142428.paterno@dsi.unifi.it> In-Reply-To: <199805140039.JAA00329@pudding.carrot.kansai.oki.co.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On 14-May-98 Hideki Yamamoto wrote about "Re: mount_msdos and msdosfs for
VFAT/FAT32 access":
>>cannot make world because it fails building the dependencies: you are looking
>
> Thank you for your patch.
You're welcome. BTW, I don't know if *that* is the Right Way (Tm). Please
review.
> I will fix my web page next time (in one or two weeks).
As you are going to do that, please consider including the attached patch: this
one will merge all -current (17th May, 00:30 UTC) changes in, plus it fixes a
warning about a missing */ at line 252 of vfsops and (TADAAAAA ;-) it fixes
mount -p problem and my export problems. Please check it against your (u)mount
problem.
Now I got:
ugo@pegasus:~/temp [0]> mount -p
[...some stuff deleted...]
/dev/sd0s1 /mnt/windows95 msdos rw 0 0
/dev/sd0s5 /mnt/limbo msdos rw 0 0
/dev/wd0s1 /mnt/xchange_1 msdos rw 0 0
/dev/wd2s1 /mnt/xchange_2 msdos rw 0 0
[...some stuff deleted...]
And no more "bad export line for blah blah" when I mount something else. I found
we were missing a "sbp->f_type = MOUNT_MSDOS;" that is present in -stable
sources at the beginning of msdosfs_statfs. Somehow -current go there with that
field initialized to the right value. Someone with some knowledge of msdosfs
should explain why.
># I started testing new -current source. It does not seem to be
># stable.
I'm going to test those too. Please note that the patch includes them.
Which kind of instability are you making reference to? I could try to reproduce
it here.
> Hideki Yamamoto (hyama@acm.org)
Bye, UP
[-- Attachment #2 --]
diff -urN msdosfs-22X-980505/msdosfs_lookup.c msdosfs/msdosfs_lookup.c
--- msdosfs-22X-980505/msdosfs_lookup.c Tue May 5 02:48:52 1998
+++ msdosfs/msdosfs_lookup.c Sun May 17 10:57:12 1998
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_lookup.c,v 1.22 1998/02/26 06:45:44 msmith Exp $ */
+/* $Id: msdosfs_lookup.c,v 1.23 1998/05/09 09:36:38 dt Exp $ */
/* $NetBSD: msdosfs_lookup.c,v 1.37 1997/11/17 15:36:54 ws Exp $ */
/*-
@@ -360,7 +360,7 @@
* this lookup.
*/
dp->de_fndoffset = diroff;
- dp->de_fndcnt = wincnt;
+ dp->de_fndcnt = wincnt - 1;
goto found;
}
diff -urN msdosfs-22X-980505/msdosfs_vfsops.c msdosfs/msdosfs_vfsops.c
--- msdosfs-22X-980505/msdosfs_vfsops.c Tue May 5 09:10:08 1998
+++ msdosfs/msdosfs_vfsops.c Sun May 17 14:00:31 1998
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vfsops.c,v 1.34 1998/04/29 12:55:51 dt Exp $ */
+/* $Id: msdosfs_vfsops.c,v 1.35 1998/05/06 05:29:38 msmith Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */
/*-
@@ -248,7 +248,7 @@
#ifdef FBSDCUR
if (args.magic != MSDOSFS_ARGSMAGIC)
args.flags = 0;
-#endif /* FBSDCUR
+#endif /* FBSDCUR */
/*
* If updating, check whether changing from read-only to
* read/write; if there is no device name, that's all we do.
@@ -942,6 +942,10 @@
struct msdosfsmount *pmp;
pmp = VFSTOMSDOSFS(mp);
+#ifndef FBSDCUR
+ sbp->f_type = MOUNT_MSDOS;
+#endif /* FBSDCUR */
+
sbp->f_bsize = pmp->pm_bpcluster;
sbp->f_iosize = pmp->pm_bpcluster;
sbp->f_blocks = pmp->pm_nmbrofclusters;
@@ -952,8 +956,6 @@
if (sbp != &mp->mnt_stat) {
#ifdef FBSDCUR
sbp->f_type = mp->mnt_vfc->vfc_typenum;
-#else
- sbp->f_type = MOUNT_MSDOS;
#endif /* FBSDCUR */
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
@@ -1128,9 +1130,6 @@
msdosfs_statfs,
msdosfs_sync,
msdosfs_vget,
-#ifdef FBSDCUR
- vfs_vrele,
-#endif /* FBSDCUR */
msdosfs_fhtovp,
msdosfs_vptofh,
msdosfs_init
diff -urN msdosfs-22X-980505/msdosfs_vnops.c msdosfs/msdosfs_vnops.c
--- msdosfs-22X-980505/msdosfs_vnops.c Sun Apr 26 02:58:17 1998
+++ msdosfs/msdosfs_vnops.c Sun May 17 11:15:49 1998
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_vnops.c,v 1.67 1998/03/26 20:52:58 phk Exp $ */
+/* $Id: msdosfs_vnops.c,v 1.68 1998/05/07 04:58:42 msmith Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */
/*-
@@ -219,13 +219,11 @@
goto bad;
if ((cnp->cn_flags & SAVESTART) == 0)
zfree(namei_zone, cnp->cn_pnbuf);
- vput(ap->a_dvp);
*ap->a_vpp = DETOV(dep);
return (0);
bad:
zfree(namei_zone, cnp->cn_pnbuf);
- vput(ap->a_dvp);
return (error);
}
@@ -250,7 +248,6 @@
default:
zfree(namei_zone, ap->a_cnp->cn_pnbuf);
- vput(ap->a_dvp);
return (EINVAL);
}
/* NOTREACHED */
@@ -1102,9 +1099,9 @@
struct componentname *a_cnp;
} */ *ap;
{
- int error;
struct denode *dep = VTODE(ap->a_vp);
struct denode *ddep = VTODE(ap->a_dvp);
+ int error;
if (ap->a_vp->v_type == VDIR)
error = EPERM;
@@ -1113,12 +1110,6 @@
#ifdef MSDOSFS_DEBUG
printf("msdosfs_remove(), dep %p, v_usecount %d\n", dep, ap->a_vp->v_usecount);
#endif
- if (ddep == dep)
- vrele(ap->a_vp);
- else
- vput(ap->a_vp); /* causes msdosfs_inactive() to be called
- * via vrele() */
- vput(ap->a_dvp);
return (error);
}
@@ -1136,8 +1127,7 @@
} */ *ap;
{
VOP_ABORTOP(ap->a_tdvp, ap->a_cnp);
- vput(ap->a_tdvp);
- return EOPNOTSUPP;
+ return (EOPNOTSUPP);
}
/*
@@ -1609,15 +1599,15 @@
} */ *ap;
{
struct componentname *cnp = ap->a_cnp;
- struct denode ndirent;
struct denode *dep;
struct denode *pdep = VTODE(ap->a_dvp);
- int error;
- int bn;
- u_long newcluster, pcl;
struct direntry *denp;
struct msdosfsmount *pmp = pdep->de_pmp;
struct buf *bp;
+ u_long newcluster, pcl;
+ int bn;
+ int error;
+ struct denode ndirent;
struct timespec ts;
/*
@@ -1708,7 +1698,6 @@
goto bad;
if ((cnp->cn_flags & SAVESTART) == 0)
zfree(namei_zone, cnp->cn_pnbuf);
- vput(ap->a_dvp);
*ap->a_vpp = DETOV(dep);
return (0);
@@ -1716,7 +1705,6 @@
clusterfree(pmp, newcluster, NULL);
bad2:
zfree(namei_zone, cnp->cn_pnbuf);
- vput(ap->a_dvp);
return (error);
}
@@ -1732,6 +1720,7 @@
register struct vnode *dvp = ap->a_dvp;
register struct componentname *cnp = ap->a_cnp;
register struct denode *ip, *dp;
+ struct proc *p = cnp->cn_proc;
int error;
ip = VTODE(vp);
@@ -1763,20 +1752,22 @@
/*
* This is where we decrement the link count in the parent
* directory. Since dos filesystems don't do this we just purge
- * the name cache and let go of the parent directory denode.
+ * the name cache.
*/
cache_purge(dvp);
- vput(dvp);
- dvp = NULL;
+#ifdef FBSDCUR
+ VOP_UNLOCK(dvp, 0, p);
+#else
+ VOP_UNLOCK(dvp);
+#endif /* FBSDCUR */
/*
* Truncate the directory that is being deleted.
*/
- error = detrunc(ip, (u_long)0, IO_SYNC, cnp->cn_cred, cnp->cn_proc);
+ error = detrunc(ip, (u_long)0, IO_SYNC, cnp->cn_cred, p);
cache_purge(vp);
+
+ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, p);
out:
- if (dvp)
- vput(dvp);
- vput(vp);
return (error);
}
@@ -1795,7 +1786,6 @@
{
zfree(namei_zone, ap->a_cnp->cn_pnbuf);
/* VOP_ABORTOP(ap->a_dvp, ap->a_cnp); ??? */
- vput(ap->a_dvp);
return (EOPNOTSUPP);
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.980517142428.paterno>
