From nobody Tue Dec 14 02:47:34 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2C89E18EAF1E for ; Tue, 14 Dec 2021 02:47:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JCjTt2MsQz3P8g for ; Tue, 14 Dec 2021 02:47:46 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f53.google.com with SMTP id x43-20020a056830246b00b00570d09d34ebso19558159otr.2 for ; Mon, 13 Dec 2021 18:47:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=z23JtZ25VQqGBV1VbKXvLNoM0Norp0hBApQGvNcip6k=; b=sEUxSBqPUpIKU5bbXV7ViTlIUMTvUN5BZJVmFU2WrO7HV0sUkMaGN3SBZ3VVQVwtEQ eicXZTaq0emojFLXJEU3Hl60jEeybPQm0os27MEXCfKJvO3AhpDbQU7aRtZ9bxoBJLmY rwSwsmYDJ+xNBa3VrWzQlWpnI0R7pqrOm1ut8REOWVvSUTmUHqKcXxpeVa+/VWNfQSNB QjrYcbPZnbw6hnC/r4RmwOmHMgom9gAfXguEvf2/iZwXDEi/cRx7hnYCTlLyrcmE5reZ Lp8WCyEXzuesidUu4FlbqBp8+L/wgmMHQKMeyNGBelyJ1lttVQgDk1jSjpP06P6DVsDL /frQ== X-Gm-Message-State: AOAM532bpjNYS14Y20nSzqPU8+iHjruNCtOpbrAQiDBcQXBqLsyZCaR1 QUqZEbcl6nw5ajQmtknb/PQvt/omr5EslDjAPcZLfF9uBJs= X-Google-Smtp-Source: ABdhPJxziMgaYJ40WM8nemTSiZpv0UzoVIOHHO0s15wlax1bdpIl9wmtVNNY/Uu9EPOEPPxZIRYM5kZ/qiBlu9gKNUw= X-Received: by 2002:a9d:7cce:: with SMTP id r14mr2062048otn.114.1639450065190; Mon, 13 Dec 2021 18:47:45 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 From: Alan Somers Date: Mon, 13 Dec 2021 19:47:34 -0700 Message-ID: Subject: Fixing VOP_READDIR for 64-bit directory cookies To: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4JCjTt2MsQz3P8g X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.53 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-1.65 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.53:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[freebsd.org]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_SPAM_LONG(0.35)[0.350]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.53:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N tldr; this change allows the NFS server to export file systems that use 64-bit directory cookies https://reviews.freebsd.org/D33404 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260375 Long story: NFSv2 included a 32-bit directory cookie with each readdir entry. NFSv3 widened it to 64-bits, and FreeBSD's SVN r22521 raised VOP_READDIR's cookies argument to a u_long. That's 64-bits on some architectures, but 32-bits on others. But since the NFS server is the only caller that uses cookies, VOP_READDIR really ought to use a 64-bit type on all architectures. For NVSv2-exported file systems, the NFS server will ignore the top 32-bits of the cookie. There are no in-tree file systems that use more than 32 bits for their directory cookies, but it matters for some FUSE file systems. Does anybody have any opinions about this change, or about whether/how to MFC it? -Alan