Source-Changes-HG archive

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

[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Clamp zfs nlinks ...



details:   https://anonhg.NetBSD.org/src/rev/ef53a35c9e0c
branches:  trunk
changeset: 1023410:ef53a35c9e0c
user:      simonb <simonb%NetBSD.org@localhost>
date:      Mon Sep 06 08:37:43 2021 +0000

description:
Clamp zfs nlinks at UINT32_MAX (nlink_t max) instead of (much) smaller
16-bit LINK_MAX until we bump LINK_MAX.  Fixes fts(3) problems with
"rm -rf" on zfs directories with > 32766 subdirectories.

Thanks mlelstv@ and mrg@ for helping debug this.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r d45820c7a240 -r ef53a35c9e0c external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c    Mon Sep 06 07:45:48 2021 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c    Mon Sep 06 08:37:43 2021 +0000
@@ -3116,7 +3116,8 @@
                links = zp->z_links + 1;
        else
                links = zp->z_links;
-       vap->va_nlink = MIN(links, LINK_MAX);   /* nlink_t limit! */
+       /* XXX NetBSD: use LINK_MAX when that value matches 32-bit nlink_t */
+       vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */
        vap->va_size = zp->z_size;
 #ifdef illumos
        vap->va_rdev = vp->v_rdev;



Home | Main Index | Thread Index | Old Index