tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: broken puffs atf
Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
> Any suggestion on how to fix that proprely? I call vref(vp) before
> mount_domount() sothat I can acccess vp->v_mountedhere after mount_domount
> sets vp to NULL, but it seems this is not The Right Way.
I tried moving VFS_EXTATTRCTL to mount_domount(). It seems to work, and atf
tests pass again. The code is cleaner, too. If nobody complains, I will commit
this and request a pullup to netbsd-6
Index: sys/kern/vfs_mount.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_mount.c,v
retrieving revision 1.13
diff -U4 -r1.13 vfs_mount.c
--- sys/kern/vfs_mount.c 13 Mar 2012 18:40:55 -0000 1.13
+++ sys/kern/vfs_mount.c 4 May 2012 15:54:27 -0000
@@ -82,8 +82,9 @@
#include <sys/kmem.h>
#include <sys/module.h>
#include <sys/mount.h>
#include <sys/namei.h>
+#include <sys/extattr.h>
#include <sys/syscallargs.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/vfs_syscalls.h>
@@ -738,10 +739,17 @@
/* Hold an additional reference to the mount across VFS_START(). */
vfs_unbusy(mp, true, NULL);
(void) VFS_STATVFS(mp, &mp->mnt_stat);
error = VFS_START(mp, 0);
- if (error)
+ if (error) {
vrele(vp);
+ } else if (flags & MNT_EXTATTR) {
+ error = VFS_EXTATTRCTL(vp->v_mountedhere,
+ EXTATTR_CMD_START, NULL, 0, NULL);
+ if (error)
+ printf("%s: failed to start extattr: error = %d",
+ vp->v_mountedhere->mnt_stat.f_mntonname, error);
+ }
/* Drop reference held for VFS_START(). */
vfs_destroy(mp);
*vpp = NULL;
return error;
Index: sys/kern/vfs_syscalls.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.455
diff -U4 -r1.455 vfs_syscalls.c
--- sys/kern/vfs_syscalls.c 2 May 2012 20:48:29 -0000 1.455
+++ sys/kern/vfs_syscalls.c 4 May 2012 15:54:27 -0000
@@ -457,32 +457,13 @@
*retval = data_len;
} else if (flags & MNT_UPDATE) {
error = mount_update(l, vp, path, flags, data_buf, &data_len);
} else {
- struct vnode *svp;
-
- /* Save vp as mount_domount sets it to NULL */
- vref(vp);
- svp = vp;
-
/* Locking is handled internally in mount_domount(). */
KASSERT(vfsopsrele == true);
error = mount_domount(l, &vp, vfsops, path, flags, data_buf,
&data_len);
vfsopsrele = false;
-
- if ((error == 0) && (flags & MNT_EXTATTR)) {
- KASSERT(svp->v_mountedhere != NULL);
-
- if (VFS_EXTATTRCTL(svp->v_mountedhere,
- EXTATTR_CMD_START,
- NULL, 0, NULL) != 0)
- printf("%s: failed to start extattr",
- svp->v_mountedhere->mnt_stat.f_mntonname);
- /* XXX remove flag */
- }
-
- vrele(svp);
}
done:
if (vfsopsrele)
--
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index