Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/kern Pull up following revision(s) (requested by manu...



details:   https://anonhg.NetBSD.org/src/rev/4a1ce0db5d97
branches:  netbsd-6
changeset: 774124:4a1ce0db5d97
user:      riz <riz%NetBSD.org@localhost>
date:      Sat May 19 15:01:35 2012 +0000

description:
Pull up following revision(s) (requested by manu in ticket #259):
        sys/kern/vfs_syscalls.c: revision 1.456
        sys/kern/vfs_mount.c: revision 1.14
        sys/kern/vfs_syscalls.c: revision 1.452
        sys/kern/vfs_syscalls.c: revision 1.453
        sys/kern/vfs_syscalls.c: revision 1.454
Do not use vp after mount_domount() call as it sets it to NULL on success.
This fixes a panic when starting extended attributes.
Fix mount -o extattr : previous patch fixed a panic but caused operation
to happen on the mount point instead of the mounted filesystem.
Fix the extattr start fix. Looking up the filesystemroot vnode again
does not seems to be reliable. Instead save it before mount_domount()
sets it to NULL.
Move VFS_EXTATTRCTL to mount_domount().  This makes the
fs/puffs/t_fuzz:mountfuzz7, fs/puffs/t_fuzz:mountfuzz8,
and fs/zfs/t_zpool:create tests pass again.  Patch from
manu, discussed on tech-kern and committed at his request.

diffstat:

 sys/kern/vfs_mount.c    |  14 +++++++++++---
 sys/kern/vfs_syscalls.c |  20 ++++++--------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diffs (101 lines):

diff -r e2ca54b5483b -r 4a1ce0db5d97 sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c      Fri May 18 17:05:16 2012 +0000
+++ b/sys/kern/vfs_mount.c      Sat May 19 15:01:35 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_mount.c,v 1.12 2011/11/18 21:17:45 christos Exp $  */
+/*     $NetBSD: vfs_mount.c,v 1.12.6.1 2012/05/19 15:01:35 riz Exp $   */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.12 2011/11/18 21:17:45 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.12.6.1 2012/05/19 15:01:35 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -83,6 +83,7 @@
 #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>
@@ -758,8 +759,15 @@
        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\n",
+                          vp->v_mountedhere->mnt_stat.f_mntonname, error);
+       }
        /* Drop reference held for VFS_START(). */
        vfs_destroy(mp);
        *vpp = NULL;
diff -r e2ca54b5483b -r 4a1ce0db5d97 sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Fri May 18 17:05:16 2012 +0000
+++ b/sys/kern/vfs_syscalls.c   Sat May 19 15:01:35 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.449.2.1 2012/05/17 18:12:12 riz Exp $       */
+/*     $NetBSD: vfs_syscalls.c,v 1.449.2.2 2012/05/19 15:01:35 riz Exp $       */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.449.2.1 2012/05/17 18:12:12 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.449.2.2 2012/05/19 15:01:35 riz Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -273,20 +273,20 @@
 
        if ((error == 0) && !(saved_flags & MNT_EXTATTR) && 
            (flags & MNT_EXTATTR)) {
-               if (VFS_EXTATTRCTL(vp->v_mount, EXTATTR_CMD_START, 
+               if (VFS_EXTATTRCTL(mp, EXTATTR_CMD_START, 
                                   NULL, 0, NULL) != 0) {
                        printf("%s: failed to start extattr, error = %d",
-                              vp->v_mount->mnt_stat.f_mntonname, error);
+                              mp->mnt_stat.f_mntonname, error);
                        mp->mnt_flag &= ~MNT_EXTATTR;
                }
        }
 
        if ((error == 0) && (saved_flags & MNT_EXTATTR) && 
            !(flags & MNT_EXTATTR)) {
-               if (VFS_EXTATTRCTL(vp->v_mount, EXTATTR_CMD_STOP, 
+               if (VFS_EXTATTRCTL(mp, EXTATTR_CMD_STOP, 
                                   NULL, 0, NULL) != 0) {
                        printf("%s: failed to stop extattr, error = %d",
-                              vp->v_mount->mnt_stat.f_mntonname, error);
+                              mp->mnt_stat.f_mntonname, error);
                        mp->mnt_flag |= MNT_RDONLY;
                }
        }
@@ -463,14 +463,6 @@
                error = mount_domount(l, &vp, vfsops, path, flags, data_buf,
                    &data_len);
                vfsopsrele = false;
-
-               if ((error == 0) && (flags & MNT_EXTATTR)) {
-                       if (VFS_EXTATTRCTL(vp->v_mount, EXTATTR_CMD_START, 
-                                          NULL, 0, NULL) != 0)
-                               printf("%s: failed to start extattr",
-                                      vp->v_mount->mnt_stat.f_mntonname);
-                               /* XXX remove flag */
-               }
        }
 
     done:



Home | Main Index | Thread Index | Old Index