Bug 270909 - find: /.zfs: Invalid argument
Summary: find: /.zfs: Invalid argument
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.2-RELEASE
Hardware: amd64 Any
: --- Affects Many People
Assignee: Mateusz Guzik
URL:
Keywords: regression
: 274381 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-18 10:06 UTC by rx5670
Modified: 2023-10-20 19:46 UTC (History)
3 users (show)

See Also:
des: mfc-stable13?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rx5670 2023-04-18 10:06:45 UTC
Hello.

I up upgraded from 12.3 to 13.2

Now when I try to find on any zfs snapdir (.zfs) I get:
find: /.zfs: Invalid argument

[root@ven-t ~]# uname -a
FreeBSD ven-t 13.2-RELEASE FreeBSD 13.2-RELEASE releng/13.2-n254617-525ecfdad597 GENERIC amd64
[root@ven-t ~]# find /.zfs
/.zfs
/.zfs/snapshot
find: /.zfs: Invalid argument
Comment 1 Marek Zarychta 2023-04-18 12:07:17 UTC
I can't reproduce on 13.2-STABLE.
Comment 2 rx5670 2023-04-18 13:16:26 UTC
Sorry I didn't mention that I use mirrored zpool

I just fresh installed 13.2-RELEASE on mirrored zpool and:

root@fbsd3:~ # zpool status
  pool: zroot
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            da0p3   ONLINE       0     0     0
            da1p3   ONLINE       0     0     0

errors: No known data errors
root@fbsd3:~ #
root@fbsd3:~ #
root@fbsd3:~ # gpart show
=>       40  134217648  da0  GPT  (64G)
         40       1024    1  freebsd-boot  (512K)
       1064        984       - free -  (492K)
       2048    4194304    2  freebsd-swap  (2.0G)
    4196352  130019328    3  freebsd-zfs  (62G)
  134215680       2008       - free -  (1.0M)

=>       40  134217648  da1  GPT  (64G)
         40       1024    1  freebsd-boot  (512K)
       1064        984       - free -  (492K)
       2048    4194304    2  freebsd-swap  (2.0G)
    4196352  130019328    3  freebsd-zfs  (62G)
  134215680       2008       - free -  (1.0M)

=>     9  523725  cd0  MBR  (1.0G)
       9  523725       - free -  (1.0G)

=>     9  523725  iso9660/13_2_RELEASE_AMD64_CD  MBR  (1.0G)
       9  523725                                 - free -  (1.0G)

root@fbsd3:~ #
root@fbsd3:~ #
root@fbsd3:~ # find /.zfs
/.zfs
/.zfs/snapshot
find: /.zfs: Invalid argument
root@fbsd3:~ #
Comment 3 Marek Zarychta 2023-04-18 13:32:55 UTC
(In reply to rx5670 from comment #2)

Indeed, the error "Invalid argument" appears at the end of the find(1) output. You can redirect stderr if it hurts you. 
Is it really a bug? I doubt it.
Comment 4 rx5670 2023-04-18 13:40:34 UTC
(In reply to Marek Zarychta from comment #3)
Actually these errors emailed from daily security checks from some scripts in /etc/periodic/security/

So I've never seen them before I updated from 12.3 to 13.2.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-04-20 08:38:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=9c4e270822a3592bf122f9a8e4e815b4602329f1

commit 9c4e270822a3592bf122f9a8e4e815b4602329f1
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-04-20 08:36:53 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-04-20 08:38:28 +0000

    zfs: fix up EINVAL from getdirentries on .zfs

    PR:     270909

 sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 6 Mateusz Guzik freebsd_committer freebsd_triage 2023-04-20 08:39:44 UTC
Thanks for the report. I fixed the problem in main, will merge to stable/13 in few days.

It may be this will be patched with an errata in 13.2.
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-04-24 16:16:53 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=84b812d5b330f6f20477da4f6577c3c84655b0a5

commit 84b812d5b330f6f20477da4f6577c3c84655b0a5
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-04-20 08:36:53 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-04-24 16:16:03 +0000

    zfs: fix up EINVAL from getdirentries on .zfs

    PR:     270909
    (cherry picked from commit 9c4e270822a3592bf122f9a8e4e815b4602329f1)

 sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 8 Mateusz Guzik freebsd_committer freebsd_triage 2023-04-24 16:17:45 UTC
Given that .zfs is hidden by default I don't think this warrants an errata after all. The bug is fixed in stable/13 as of now though.
Comment 9 John Baldwin freebsd_committer freebsd_triage 2023-10-20 19:46:22 UTC
*** Bug 274381 has been marked as a duplicate of this bug. ***