Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ufs There is no difference between a zero-sized and ...



details:   https://anonhg.NetBSD.org/src/rev/463e9db53a78
branches:  trunk
changeset: 932158:463e9db53a78
user:      hannken <hannken%NetBSD.org@localhost>
date:      Fri May 01 08:43:37 2020 +0000

description:
There is no difference between a zero-sized and not yet
reclaimed directory vnode and a non-existent vnode.

Teach ufs_fhtovp() to treat zero-sized directories as stale.

PR kern/55211 (fs/vfs/t_vnops:nfs_dir_rmdirdotdot test fails)

diffstat:

 sys/ufs/ufs/ufs_vfsops.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r d65e471269b9 -r 463e9db53a78 sys/ufs/ufs/ufs_vfsops.c
--- a/sys/ufs/ufs/ufs_vfsops.c  Fri May 01 08:43:00 2020 +0000
+++ b/sys/ufs/ufs/ufs_vfsops.c  Fri May 01 08:43:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_vfsops.c,v 1.59 2020/01/17 20:08:10 ad Exp $       */
+/*     $NetBSD: ufs_vfsops.c,v 1.60 2020/05/01 08:43:37 hannken Exp $  */
 
 /*
  * Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vfsops.c,v 1.59 2020/01/17 20:08:10 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vfsops.c,v 1.60 2020/05/01 08:43:37 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -247,7 +247,8 @@
        }
        ip = VTOI(nvp);
        KASSERT(ip != NULL);
-       if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen) {
+       if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen ||
+           ((ip->i_mode & IFMT) == IFDIR && ip->i_size == 0)) {
                vput(nvp);
                *vpp = NULLVP;
                return (ESTALE);



Home | Main Index | Thread Index | Old Index