ZFS ".": Invalid argument (os error 22)

rigoletto@

Developer
Hello,

I can't use ls inside any .zfs (snapshots) directory using my $USER because I get this error:

Code:
".": Invalid argument (os error 22)

Directory permissions:

Code:
dr-xr-xr-x+ 3 root  wheel  3 Jun 30  2017 .zfs

No idea when this issue started but it was been like that for a while...

Thanks.
 
Yes this is the folder in there and I can access it and everything, but for some reason I can't ls inside the .zfs directory (specifically).
 
I can't use ls inside any .zfs (snapshots) directory using my $USER because I get this error:
What does "using my $USER" mean?

I have no idea what causes this problem, but we know it is some system or library function being called with an invalid argument. Suggestion: Find out which function it is, with "truss ls", and looking for what returns 22 or sets errno to 22.
 
Also as root ?
You did not delegated zfs permissions ?
It works as expected for root.

What does "using my $USER" mean?

I have no idea what causes this problem, but we know it is some system or library function being called with an invalid argument. Suggestion: Find out which function it is, with "truss ls", and looking for what returns 22 or sets errno to 22.

$USER = rigoletto.

Thanks!
 
I can't reproduce that. Using a samba "domain" user here:
Code:
$ cd /mnt/storage/.zfs
$ ls
snapshot
This is on 13.1-RELEASE.
 
Nothing that was called my attention:

Code:
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.1-RELEASE-p4 releng/13.1-n250171-95499c45614c GENERIC amd64
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
CPU: AMD FX(tm)-8120 Eight-Core Processor            (3100.05-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x600f12  Family=0x15  Model=0x1  Stepping=2
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x1e98220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AESNI,XSAVE,OSXSAVE,AVX>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x1c9bfff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,XOP,SKINIT,WDT,LWP,FMA4,NodeId,Topology,PCXC,PNXC>
  SVM: NP,NRIP,VClean,AFlush,DAssist,NAsids=65536
  TSC: P-state invariant, performance statistics
real memory  = 17179869184 (16384 MB)
avail memory = 16587796480 (15819 MB)
Event timer "LAPIC" quality 100
ACPI APIC Table: <102512 APIC1719>
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs
FreeBSD/SMP: 1 package(s) x 8 core(s)
random: unblocking device.
Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/32 (20201113/tbfadt-748)
ioapic0: MADT APIC ID 24 != hw id 8
ioapic0 <Version 2.1> irqs 0-23
Launching APs: 1 3 2 7 6 5 4
random: entropy device external interface
kbd1 at kbdmux0
nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  390.154  Wed Jun 22 04:42:19 UTC 2022
smbios0: <System Management BIOS> at iomem 0xfbf80-0xfbf9e
smbios0: Version: 2.5
aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS>
acpi0: <102512 XSDT1719>
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 350
Event timer "HPET1" frequency 14318180 Hz quality 350
Event timer "HPET2" frequency 14318180 Hz quality 350
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
acpi_ec0: <Embedded Controller: GPE 0xa> port 0x62,0x66 on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 18 at device 2.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> port 0xdc00-0xdc7f mem 0xfd000000-0xfdffffff,0xf0000000-0xf7ffffff,0xf8000000-0xf9ffffff irq 18 at device 0.0 on pci1
nvidia0: <GeForce GT 630> on vgapci0
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: Boot video device
hdac0: <NVIDIA GT108 HDA Controller> mem 0xfea7c000-0xfea7ffff irq 19 at device 0.1 on pci1
pcib2: <ACPI PCI-PCI bridge> irq 19 at device 7.0 on pci0
pci2: <ACPI PCI bus> on pcib2
xhci0: <ASMedia ASM1042 USB 3.0 controller> mem 0xfebf0000-0xfebf7fff irq 19 at device 0.0 on pci2
xhci0: 32 bytes context size, 32-bit DMA
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
pcib3: <ACPI PCI-PCI bridge> irq 18 at device 10.0 on pci0
pci3: <ACPI PCI bus> on pcib3
re0: <RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet> port 0xe800-0xe8ff mem 0xfbfff000-0xfbffffff,0xfbff8000-0xfbffbfff irq 18 at device 0.0 on pci3
re0: Using 1 MSI-X message
re0: Chip rev. 0x2c800000
re0: MAC rev. 0x00100000
miibus0: <MII bus> on re0
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
rgephy0:  none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow
re0: Using defaults for TSO: 65518/35/2048
re0: Ethernet address: c8:60:00:ed:67:89
re0: netmap queues/slots: TX 1/256, RX 1/256
ahci0: <AMD SB7x0/SB8x0/SB9x0 AHCI SATA controller> port 0xc000-0xc007,0xb000-0xb003,0xa000-0xa007,0x9000-0x9003,0x8000-0x800f mem 0xfcfffc00-0xfcffffff irq 19 at device 17.0 on pci0
ahci0: AHCI v1.20 with 4 6Gbps ports, Port Multiplier supported
ahci0: quirks=0x22000<ATI_PMP_BUG,1MSI>
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich3: <AHCI channel> at channel 3 on ahci0
ohci0: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfcffe000-0xfcffefff irq 18 at device 18.0 on pci0
usbus1 on ohci0
usbus1: 12Mbps Full Speed USB v1.0
ehci0: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfcfff800-0xfcfff8ff irq 17 at device 18.2 on pci0
usbus2: EHCI version 1.0
usbus2 on ehci0
usbus2: 480Mbps High Speed USB v2.0
ohci1: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfcffd000-0xfcffdfff irq 18 at device 19.0 on pci0
usbus3 on ohci1
usbus3: 12Mbps Full Speed USB v1.0
ehci1: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfcfff400-0xfcfff4ff irq 17 at device 19.2 on pci0
usbus4: EHCI version 1.0
usbus4 on ehci1
usbus4: 480Mbps High Speed USB v2.0
atapci0: <ATI IXP700/800 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xff00-0xff0f at device 20.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
hdac1: <ATI SB600 HDA Controller> mem 0xfcff8000-0xfcffbfff irq 16 at device 20.2 on pci0
isab0: <PCI-ISA bridge> at device 20.3 on pci0
isa0: <ISA bus> on isab0
pcib4: <ACPI PCI-PCI bridge> at device 20.4 on pci0
pci4: <ACPI PCI bus> on pcib4
ohci2: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfcffc000-0xfcffcfff irq 18 at device 20.5 on pci0
usbus5 on ohci2
usbus5: 12Mbps Full Speed USB v1.0
ohci3: <AMD SB7x0/SB8x0/SB9x0 USB controller> mem 0xfcff7000-0xfcff7fff irq 18 at device 22.0 on pci0
usbus6 on ohci3
usbus6: 12Mbps Full Speed USB v1.0
ehci2: <AMD SB7x0/SB8x0/SB9x0 USB 2.0 controller> mem 0xfcfff000-0xfcfff0ff irq 17 at device 22.2 on pci0
usbus7: EHCI version 1.0
usbus7 on ehci2
usbus7: 480Mbps High Speed USB v2.0
amdtemp0: <AMD CPU On-Die Thermal Sensors> on hostb4
acpi_button0: <Power Button> on acpi0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
WARNING: Device "consolectl" is Giant locked and may be deleted before FreeBSD 14.0.
sc0: non-PNP ISA device will be removed from GENERIC in FreeBSD 14.
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff pnpid PNP0900 on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbdc0: non-PNP ISA device will be removed from GENERIC in FreeBSD 14.
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
Timecounter "TSC-low" frequency 1549982023 Hz quality 1000
Timecounters tick every 1.000 msec
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
ugen1.1: <ATI OHCI root HUB> at usbus1
ugen2.1: <ATI EHCI root HUB> at usbus2
ugen4.1: <ATI EHCI root HUB> at usbus4
ugen0.1: <(0x1b21) XHCI root HUB> at usbus0
ugen5.1: <ATI OHCI root HUB> at usbus5
ugen3.1: <ATI OHCI root HUB> at usbus3
ugen7.1: <ATI EHCI root HUB> at usbus7
uhub0 on usbus1
uhub0: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
uhub1 on usbus4
uhub1: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus4
uhub2 on usbus3
uhub2: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
ugen6.1: <ATI OHCI root HUB> at usbus6
hdacc0: <NVIDIA GT440 HDA CODEC> at cad 0 on hdac0
hdaa0: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc0
pcm0: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa0
hdacc1: <NVIDIA GT440 HDA CODEC> at cad 1 on hdac0
hdaa1: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc1
pcm1: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa1
hdacc2: <NVIDIA GT440 HDA CODEC> at cad 2 on hdac0
hdaa2: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc2
pcm2: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa2
hdacc3: <NVIDIA GT440 HDA CODEC> at cad 3 on hdac0
hdaa3: <NVIDIA GT440 Audio Function Group> at nid 1 on hdacc3
pcm3: <NVIDIA GT440 (HDMI/DP 8ch)> at nid 5 on hdaa3
hdacc4: <Realtek ALC892 HDA CODEC> at cad 0 on hdac1
hdaa4: <Realtek ALC892 Audio Function Group> at nid 1 on hdacc4
pcm4: <Realtek ALC892 (Rear Analog 7.1/2.0)> at nid 20,22,21,23 and 24,26 on hdaa4
pcm5: <Realtek ALC892 (Front Analog)> at nid 27 and 25 on hdaa4
pcm6: <Realtek ALC892 (Rear Digital)> at nid 30 on hdaa4
pcm7: <Realtek ALC892 (Onboard Digital)> at nid 17 on hdaa4
Trying to mount root from zfs:zroot/ROOT/13.1 []...
uhub3 on usbus2
uhub3: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
uhub4 on usbus0
uhub4: <(0x1b21) XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
uhub5 on usbus7
uhub5: <ATI EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus7
uhub6 on usbus5
uhub6: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus5
uhub7 on usbus6
uhub7: <ATI OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus6
uhub2: 5 ports with 5 removable, self powered
uhub6: 2 ports with 2 removable, self powered
uhub7: 4 ports with 4 removable, self powered
uhub0: 5 ports with 5 removable, self powered
uhub4: 4 ports with 4 removable, self powered
Root mount waiting for: CAM usbus2 usbus4 usbus7
uhub5: 4 ports with 4 removable, self powered
uhub1: 5 ports with 5 removable, self powered
uhub3: 5 ports with 5 removable, self powered
Root mount waiting for: CAM usbus2
ugen3.2: <Logitech USB Optical Mouse> at usbus3
ugen1.2: <Microsoft Wired Keyboard 600> at usbus1
ukbd0 on uhub0
ukbd0: <Microsoft Wired Keyboard 600, class 0/0, rev 1.10/1.10, addr 2> on usbus1
kbd2 at ukbd0
Root mount waiting for: CAM
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <SanDisk SSD PLUS 120GB UE4500RL> ACS-2 ATA SATA 3.x device
ada0: Serial Number 1838DB806764
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)
ada0: Command Queueing enabled
ada0: 114480MB (234455040 512 byte sectors)
ada1 at ahcich1 bus 0 scbus1 target 0 lun 0
ada1: <ST500DM002-1SB10A CC43> ATA8-ACS SATA 3.x device
ada1: Serial Number ZA43WD4M
ada1: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 476940MB (976773168 512 byte sectors)
ada1: quirks=0x1<4K>
ada2 at ahcich2 bus 0 scbus2 target 0 lun 0
ada2: <ST500DM002-1BD142 KC45> ATA8-ACS SATA 3.x device
ada2: Serial Number S2AA52AA
ada2: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada2: Command Queueing enabled
ada2: 476940MB (976773168 512 byte sectors)
ada2: quirks=0x1<4K>
ada3 at ahcich3 bus 0 scbus3 target 0 lun 0
ada3: <SAMSUNG HD103SJ 1AJ10001> ATA8-ACS SATA 2.x device
ada3: Serial Number S246JD1B402832
ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada3: Command Queueing enabled
ada3: 953869MB (1953525168 512 byte sectors)
ada4 at ata0 bus 0 scbus4 target 1 lun 0
ada4: <MAXTOR STM3160215AS 4.AAB> ATA-7 SATA 1.x device
ada4: Serial Number 6RA9TZ27
ada4: 150.000MB/s transfers (SATA, UDMA6, PIO 8192bytes)
ada4: 152627MB (312581808 512 byte sectors)
GEOM_ELI: Device ada4p1.eli created.
GEOM_ELI: Encryption: AES-XTS 128
GEOM_ELI:     Crypto: accelerated software
intsmb0: <AMD SB600/7xx/8xx/9xx SMBus Controller> at device 20.0 on pci0
smbus0: <System Management Bus> on intsmb0
acpi_wmi0: <ACPI-WMI mapping> on acpi0
acpi_wmi0: Embedded MOF found
ACPI: \134AOD.WQBA: 1 arguments were passed to a non-method ACPI object (Buffer) (20201113/nsarguments-361)
lo0: link state changed to UP
re0: link state changed to DOWN
re0: link state changed to UP
ums0 on uhub2
ums0: <Logitech USB Optical Mouse, class 0/0, rev 2.00/72.00, addr 2> on usbus3
ums0: 3 buttons and [XYZ] coordinates ID=0
uhid0 on uhub0
uhid0: <Microsoft Wired Keyboard 600, class 0/0, rev 1.10/1.10, addr 2> on usbus1
pflog0: promiscuous mode enabled
vboxdrv: XXXXXXXXXXXXXXXX VMMR0.r0
vboxdrv: XXXXXXXXXXXXXXXX VBoxDDR0.r0
VMMR0InitVM: eflags=246 fKernelFeatures=0x0 (SUPKERNELFEATURES_SMAP=0)

Thank you.
 
A shot in the dark, as these are virtual directories somehow handled inside ZFS code (I guess) – is the pool fully upgraded?
 
Back
Top