Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs Don't cache id's for vnodes that have ACLs. ok chs@



details:   https://anonhg.NetBSD.org/src/rev/2a09558592f1
branches:  trunk
changeset: 975025:2a09558592f1
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 20 20:28:13 2020 +0000

description:
Don't cache id's for vnodes that have ACLs. ok chs@

diffstat:

 sys/ufs/ffs/ffs_vfsops.c |   8 ++++----
 sys/ufs/ufs/inode.h      |  10 +++++++++-
 sys/ufs/ufs/ufs_vnops.c  |  10 +++++-----
 3 files changed, 18 insertions(+), 10 deletions(-)

diffs (105 lines):

diff -r bd404dce9560 -r 2a09558592f1 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Thu Aug 20 19:43:42 2020 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Thu Aug 20 20:28:13 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.371 2020/07/05 20:37:40 christos Exp $        */
+/*     $NetBSD: ffs_vfsops.c,v 1.372 2020/08/20 20:28:13 christos Exp $        */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.371 2020/07/05 20:37:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.372 2020/08/20 20:28:13 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -2139,7 +2139,7 @@
                ip->i_gid = ip->i_ffs1_ogid;                    /* XXX */
        }                                                       /* XXX */
        uvm_vnp_setsize(vp, ip->i_size);
-       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, true);
+       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, !HAS_ACLS(ip));
        *new_key = &ip->i_number;
        return 0;
 }
@@ -2261,7 +2261,7 @@
        }
 
        uvm_vnp_setsize(vp, ip->i_size);
-       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, true);
+       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, !HAS_ACLS(ip));
        *new_key = &ip->i_number;
        return 0;
 }
diff -r bd404dce9560 -r 2a09558592f1 sys/ufs/ufs/inode.h
--- a/sys/ufs/ufs/inode.h       Thu Aug 20 19:43:42 2020 +0000
+++ b/sys/ufs/ufs/inode.h       Thu Aug 20 20:28:13 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inode.h,v 1.77 2020/04/18 19:18:34 christos Exp $      */
+/*     $NetBSD: inode.h,v 1.78 2020/08/20 20:28:13 christos Exp $      */
 
 /*
  * Copyright (c) 1982, 1989, 1993
@@ -238,6 +238,14 @@
 #if defined(_KERNEL)
 
 /*
+ * This macro does not differentiate between having extattrs and having
+ * extattrs containing ACLS, but that's ok since it is only used to
+ * determine if we are eligible for namei cache and we can be pessimistic
+ */
+#define HAS_ACLS(ip) \
+    ((ip)->i_ump->um_fstype == UFS2 && (ip)->i_ffs2_extsize > 0)
+
+/*
  * The DIP macro is used to access fields in the dinode that are
  * not cached in the inode itself.
  */
diff -r bd404dce9560 -r 2a09558592f1 sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c   Thu Aug 20 19:43:42 2020 +0000
+++ b/sys/ufs/ufs/ufs_vnops.c   Thu Aug 20 20:28:13 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_vnops.c,v 1.255 2020/05/18 08:28:44 hannken Exp $  */
+/*     $NetBSD: ufs_vnops.c,v 1.256 2020/08/20 20:28:13 christos Exp $ */
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.255 2020/05/18 08:28:44 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.256 2020/08/20 20:28:13 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -669,7 +669,7 @@
        }
        VN_KNOTE(vp, NOTE_ATTRIB);
 out:
-       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, true);
+       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, !HAS_ACLS(ip));
        return (error);
 }
 
@@ -740,7 +740,7 @@
        ip->i_flag |= IN_CHANGE;
        DIP_ASSIGN(ip, mode, ip->i_mode);
        UFS_WAPBL_UPDATE(vp, NULL, NULL, 0);
-       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, true);
+       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, !HAS_ACLS(ip));
        return (0);
 }
 
@@ -810,7 +810,7 @@
 #endif /* QUOTA || QUOTA2 */
        ip->i_flag |= IN_CHANGE;
        UFS_WAPBL_UPDATE(vp, NULL, NULL, 0);
-       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, true);
+       cache_enter_id(vp, ip->i_mode, ip->i_uid, ip->i_gid, !HAS_ACLS(ip));
        return (0);
 }
 



Home | Main Index | Thread Index | Old Index