cannot mount tmpfs on 6.3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

cannot mount tmpfs on 6.3

KAWAMATA Yoshihiro
I built a 6.3 kernel with tmpfs enabled.

Here's a diff of this kernel with GENERIC:

# diff -u GENERIC GENERIC_TMPFS
--- GENERIC     Thu Mar 15 03:52:16 2018
+++ GENERIC_TMPFS       Thu Apr  5 00:56:50 2018
@@ -11,6 +11,7 @@
 
 machine                amd64
 include                "../../../conf/GENERIC"
+option         TMPFS           # efficient memory file system
 maxusers       80                      # estimated number of users
 
 option         USER_PCICONF    # user-space PCI configuration

And I tried to mount tmpfs on this kernel, but it didn't:

# mount_tmpfs tmpfs /root/mnt_test
mount_tmpfs: tmpfs on /root/mnt_test: Bad address

It worked up to 6.2 release.


full dmesg:

OpenBSD 6.3-stable (GENERIC_TMPFS) #0: Thu Apr  5 01:39:39 JST 2018
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC_TMPFS
real mem = 3463262208 (3302MB)
avail mem = 3351334912 (3196MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xf70b0 (61 entries)
bios0: vendor Dell Inc. version "A05" date 04/02/2007
bios0: Dell Inc. Latitude D520
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC MCFG SLIC SSDT
acpi0: wakeup devices LID_(S3) PBTN(S4) PCI0(S4) USB0(S0) USB1(S0) USB2(S0) USB3(S0) EHCI(S0) AZAL(S3) PCIE(S4) RP01(S3) RP02(S4) RP03(S3) RP04(S3) RP05(S3) RP06(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz, 1662.73 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF,SENSOR,MELTDOWN
cpu0: 2MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 166MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
, remapped to apid 2
acpimcfg0 at acpi0 addr 0xf0000000, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (PCIE)
acpiprt2 at acpi0: bus 11 (RP01)
acpiprt3 at acpi0: bus 12 (RP02)
acpiprt4 at acpi0: bus -1 (RP03)
acpiprt5 at acpi0: bus -1 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpicpu0 at acpi0: !C3(100@57 io@0x1016), !C2(500@1 io@0x1014), C1(1000@1 halt), PSS
acpitz0 at acpi0: critical temperature is 126 degC
"*pnp0c14" at acpi0 not configured
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "DELL 0000Y8" serial 576 type LION oem "Sony"
acpibat1 at acpi0: BAT1 not present
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: PBTN
acpibtn2 at acpi0: SBTN
acpidock0 at acpi0: GDCK not docked (0)
acpivideo0 at acpi0: VID_
acpivout0 at acpivideo0: LCD_
acpivideo1 at acpi0: VID2
cpu0: Enhanced SpeedStep 1662 MHz: speeds: 1667, 1333, 1000 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82945GM Host" rev 0x03
inteldrm0 at pci0 dev 2 function 0 "Intel 82945GM Video" rev 0x03
drm0 at inteldrm0
intagp0 at inteldrm0
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0: apic 2 int 16
inteldrm0: 848x480, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 82945GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x01: msi
azalia0: codecs: Sigmatel STAC9200, Conexant/0x2bfa, using Sigmatel STAC9200
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: msi
pci1 at ppb0 bus 11
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x01: msi
pci2 at ppb1 bus 12
wpi0 at pci2 dev 0 function 0 "Intel PRO/Wireless 3945ABG" rev 0x02: msi, JPN, address 00:1b:77:01:4e:fe
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x01: apic 2 int 20
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x01: apic 2 int 21
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x01: apic 2 int 22
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x01: apic 2 int 23
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x01: apic 2 int 20
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb2 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe1
pci3 at ppb2 bus 2
bce0 at pci3 dev 0 function 0 "Broadcom BCM4401B1" rev 0x02: apic 2 int 17, address 00:19:b9:6c:60:dd
bmtphy0 at bce0 phy 1: BCM4401 10/100baseTX PHY, rev. 0
cbb0 at pci3 dev 1 function 0 "O2 Micro OZ711EZ1 CardBus" rev 0x21: apic 2 int 19
"O2 Micro Firewire" rev 0x02 at pci3 dev 1 function 4 not configured
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 3 device 0 cacheline 0x0, lattimer 0x20
pcmcia0 at cardslot0
pcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x01
pciide0 at pci0 dev 31 function 2 "Intel 82801GBM SATA" rev 0x01: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <MARSHAL MAL2320SA-T54>
wd0: 16-sector PIO, LBA48, 305245MB, 625142448 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <TSSTcorp, CDRW/DVD TSL462D, DE01> ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x01: apic 2 int 17
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 2GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
spdmem1 at iic0 addr 0x52: 2GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pms0: ALPS Glidepoint, version 0x7321
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
uhub5 at uhub0 port 2 configuration 1 interface 0 "Dell product 0xa005" rev 2.00/50.18 addr 2
umass0 at uhub0 port 4 configuration 1 interface 0 "Western Digital Ext HDD 1021" rev 2.00/20.02 addr 3
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd0 at scsibus2 targ 1 lun 0: <WD, Ext HDD 1021, 2002> SCSI2 0/direct fixed serial.10581021343533383436
sd0: 1430797MB, 512 bytes/sector, 2930272256 sectors
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0f (89fb3b5bd471024d.f) swap on sd0b dump on sd0b

Reply | Threaded
Open this post in threaded view
|

Re: cannot mount tmpfs on 6.3

Patrick Wildt-3
On Thu, Apr 05, 2018 at 12:20:15PM +0900, KAWAMATA Yoshihiro wrote:

> I built a 6.3 kernel with tmpfs enabled.
>
> Here's a diff of this kernel with GENERIC:
>
> # diff -u GENERIC GENERIC_TMPFS
> --- GENERIC     Thu Mar 15 03:52:16 2018
> +++ GENERIC_TMPFS       Thu Apr  5 00:56:50 2018
> @@ -11,6 +11,7 @@
>  
>  machine                amd64
>  include                "../../../conf/GENERIC"
> +option         TMPFS           # efficient memory file system
>  maxusers       80                      # estimated number of users
>  
>  option         USER_PCICONF    # user-space PCI configuration
>
> And I tried to mount tmpfs on this kernel, but it didn't:
>
> # mount_tmpfs tmpfs /root/mnt_test
> mount_tmpfs: tmpfs on /root/mnt_test: Bad address


I have seen that issue as well.  I think it's because we are now
being passed the data and we don't have to do the copyin ourselves.
When the conversion happened, someone forgot to remove the copyin.

Does this help?

diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
index 7fe10c5f00e..b4d671d1160 100644
--- a/sys/tmpfs/tmpfs_vfsops.c
+++ b/sys/tmpfs/tmpfs_vfsops.c
@@ -121,9 +121,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
  if (tmpfs_mem_info(1) < TMPFS_PAGES_RESERVED)
  return EINVAL;
 
- error = copyin(data, args, sizeof(struct tmpfs_args));
- if (error)
- return error;
  if (args->ta_root_uid == VNOVAL || args->ta_root_gid == VNOVAL ||
     args->ta_root_mode == VNOVAL)
  return EINVAL;

Reply | Threaded
Open this post in threaded view
|

Re: cannot mount tmpfs on 6.3

KAWAMATA Yoshihiro
It worked well.
Very thanks

From: Patrick Wildt <[hidden email]>
Subject: Re: cannot mount tmpfs on 6.3
Date: Thu, 5 Apr 2018 11:41:51 +0200
Message-ID: <[hidden email]>

> I have seen that issue as well.  I think it's because we are now
> being passed the data and we don't have to do the copyin ourselves.
> When the conversion happened, someone forgot to remove the copyin.
>
> Does this help?
>
> diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
> index 7fe10c5f00e..b4d671d1160 100644
> --- a/sys/tmpfs/tmpfs_vfsops.c
> +++ b/sys/tmpfs/tmpfs_vfsops.c
> @@ -121,9 +121,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
>   if (tmpfs_mem_info(1) < TMPFS_PAGES_RESERVED)
>   return EINVAL;
>  
> - error = copyin(data, args, sizeof(struct tmpfs_args));
> - if (error)
> - return error;
>   if (args->ta_root_uid == VNOVAL || args->ta_root_gid == VNOVAL ||
>      args->ta_root_mode == VNOVAL)
>   return EINVAL;
>

Reply | Threaded
Open this post in threaded view
|

Re: cannot mount tmpfs on 6.3

Alexander Bluhm
In reply to this post by Patrick Wildt-3
On Thu, Apr 05, 2018 at 11:41:51AM +0200, Patrick Wildt wrote:
> I have seen that issue as well.  I think it's because we are now
> being passed the data and we don't have to do the copyin ourselves.
> When the conversion happened, someone forgot to remove the copyin.
>
> Does this help?

OK bluhm@

> diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
> index 7fe10c5f00e..b4d671d1160 100644
> --- a/sys/tmpfs/tmpfs_vfsops.c
> +++ b/sys/tmpfs/tmpfs_vfsops.c
> @@ -121,9 +121,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
>   if (tmpfs_mem_info(1) < TMPFS_PAGES_RESERVED)
>   return EINVAL;
>  
> - error = copyin(data, args, sizeof(struct tmpfs_args));
> - if (error)
> - return error;
>   if (args->ta_root_uid == VNOVAL || args->ta_root_gid == VNOVAL ||
>      args->ta_root_mode == VNOVAL)
>   return EINVAL;