microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.25k stars 812 forks source link

Copy failure result in Input/output error and Read-only file system #6401

Closed guillotjulien closed 3 years ago

guillotjulien commented 3 years ago

Environment

Windows build number: Microsoft Windows [version 10.0.19041.685]
Your Distribution version: Ubuntu 20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

  1. Try to copy a big file from host filesystem to WSL filesystem (mine is 2.3G) with cp /mnt/c/User/test/bigfile /another/location
  2. Command fails with cp: error writing '/another/location/bigfile': Input/output error
  3. Attempt to create a file in /home or any other place result in Read-only file system (touch: cannot touch 'test': Read-only file system)

After a wsl --shutdown, file system is writable again, and performing the aforementionned steps create the problem again.

dmesg output:

[    0.000000] Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020
[    0.000000] Command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=5
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Centaur CentaurHauls
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x020: 'AVX-512 opmask'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x040: 'AVX-512 Hi256'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x080: 'AVX-512 ZMM_Hi256'
[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000] x86/fpu: xstate_offset[5]:  832, xstate_sizes[5]:   64
[    0.000000] x86/fpu: xstate_offset[6]:  896, xstate_sizes[6]:  512
[    0.000000] x86/fpu: xstate_offset[7]: 1408, xstate_sizes[7]: 1024
[    0.000000] x86/fpu: Enabled xstate features 0xe7, context size is 2432 bytes, using 'compacted' format.
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[    0.000000] BIOS-e820: [mem 0x00000000000e0000-0x00000000000e0fff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000001fffff] ACPI data
[    0.000000] BIOS-e820: [mem 0x0000000000200000-0x00000000f7ffffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x0000000107ffffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI not present or invalid.
[    0.000000] Hypervisor detected: Microsoft Hyper-V
[    0.000000] Hyper-V: features 0xae7f, hints 0x20e24, misc 0x20bed7b2
[    0.000000] Hyper-V Host Build:19041-10.0-0-0.685
[    0.000000] Hyper-V: LAPIC Timer Frequency: 0x1e8480
[    0.000000] tsc: Marking TSC unstable due to running on Hyper-V
[    0.000000] Hyper-V: Using hypercall for remote TLB flush
[    0.000000] tsc: Detected 1497.602 MHz processor
[    0.000028] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000029] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000032] last_pfn = 0x108000 max_arch_pfn = 0x400000000
[    0.000058] MTRR default type: uncachable
[    0.000058] MTRR fixed ranges disabled:
[    0.000059]   00000-FFFFF uncachable
[    0.000060] MTRR variable ranges disabled:
[    0.000060]   0 disabled
[    0.000061]   1 disabled
[    0.000061]   2 disabled
[    0.000061]   3 disabled
[    0.000061]   4 disabled
[    0.000062]   5 disabled
[    0.000062]   6 disabled
[    0.000063]   7 disabled
[    0.000064] Disabled
[    0.000066] x86/PAT: MTRRs disabled, skipping PAT initialization too.
[    0.000074] CPU MTRRs all blank - virtualized system.
[    0.000076] x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC  
[    0.000078] last_pfn = 0xf8000 max_arch_pfn = 0x400000000
[    0.000119] Using GB pages for direct mapping
[    0.000124] BRK [0x02e00000, 0x02e00fff] PGTABLE
[    0.000126] BRK [0x02e01000, 0x02e01fff] PGTABLE
[    0.000127] BRK [0x02e02000, 0x02e02fff] PGTABLE
[    0.000160] BRK [0x02e03000, 0x02e03fff] PGTABLE
[    0.000209] BRK [0x02e04000, 0x02e04fff] PGTABLE
[    0.000286] RAMDISK: [mem 0x02e35000-0x02e44fff]
[    0.000291] ACPI: Early table checksum verification disabled
[    0.000332] ACPI: RSDP 0x00000000000E0000 000024 (v02 VRTUAL)
[    0.000339] ACPI: XSDT 0x0000000000100000 000044 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000347] ACPI: FACP 0x0000000000101000 000114 (v06 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000361] ACPI: DSDT 0x00000000001011B8 01E184 (v02 MSFTVM DSDT01   00000001 MSFT 05000000)
[    0.000369] ACPI: FACS 0x0000000000101114 000040
[    0.000374] ACPI: OEM0 0x0000000000101154 000064 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000379] ACPI: SRAT 0x000000000011F33C 000260 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000385] ACPI: APIC 0x000000000011F59C 000070 (v04 VRTUAL MICROSFT 00000001 MSFT 00000001)
[    0.000397] ACPI: Local APIC address 0xfee00000
[    0.001232] Zone ranges:
[    0.001233]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.001234]   DMA32    [mem 0x0000000001000000-0x00000000ffffffff]
[    0.001234]   Normal   [mem 0x0000000100000000-0x0000000107ffffff]
[    0.001235] Movable zone start for each node
[    0.001235] Early memory node ranges
[    0.001236]   node   0: [mem 0x0000000000001000-0x000000000009ffff]
[    0.001236]   node   0: [mem 0x0000000000200000-0x00000000f7ffffff]
[    0.001237]   node   0: [mem 0x0000000100000000-0x0000000107ffffff]
[    0.001417] Zeroed struct page in unavailable ranges: 353 pages
[    0.001418] Initmem setup node 0 [mem 0x0000000000001000-0x0000000107ffffff]
[    0.001419] On node 0 totalpages: 1048223
[    0.001420]   DMA zone: 59 pages used for memmap
[    0.001420]   DMA zone: 22 pages reserved
[    0.001421]   DMA zone: 3743 pages, LIFO batch:0
[    0.001475]   DMA32 zone: 16320 pages used for memmap
[    0.001476]   DMA32 zone: 1011712 pages, LIFO batch:63
[    0.023470]   Normal zone: 512 pages used for memmap
[    0.023472]   Normal zone: 32768 pages, LIFO batch:7
[    0.024146] ACPI: Local APIC address 0xfee00000
[    0.024153] ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])
[    0.024385] IOAPIC[0]: apic_id 5, version 17, address 0xfec00000, GSI 0-23
[    0.024388] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.024390] ACPI: IRQ9 used by override.
[    0.024392] Using ACPI (MADT) for SMP configuration information
[    0.024393] smpboot: Allowing 5 CPUs, 0 hotplug CPUs
[    0.024400] [mem 0xf8000000-0xffffffff] available for PCI devices
[    0.024401] Booting paravirtualized kernel on bare hardware
[    0.024402] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.117289] random: get_random_bytes called from start_kernel+0x93/0x4be with crng_init=0
[    0.117296] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:5 nr_node_ids:1
[    0.118377] percpu: Embedded 42 pages/cpu s133400 r8192 d30440 u1048576
[    0.118398] pcpu-alloc: s133400 r8192 d30440 u1048576 alloc=1*2097152
[    0.118398] pcpu-alloc: [0] 0 1 [0] 2 3 [0] 4 - 
[    0.118408] Built 1 zonelists, mobility grouping on.  Total pages: 1031310
[    0.118410] Kernel command line: initrd=\initrd.img panic=-1 pty.legacy_count=0 nr_cpus=5
[    0.118876] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
[    0.119209] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[    0.135043] Memory: 4023428K/4192892K available (14360K kernel code, 1575K rwdata, 2856K rodata, 1512K init, 2756K bss, 169464K reserved, 0K cma-reserved)
[    0.135312] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=5, Nodes=1
[    0.135316] ftrace: allocating 41883 entries in 164 pages
[    0.147500] rcu: Hierarchical RCU implementation.
[    0.147501] rcu:     RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=5.
[    0.147502]  All grace periods are expedited (rcu_expedited).
[    0.147503] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=5
[    0.149823] Using NULL legacy PIC
[    0.149825] NR_IRQS: 16640, nr_irqs: 464, preallocated irqs: 0
[    0.150244] Console: colour dummy device 80x25
[    0.150246] console [tty0] enabled
[    0.150250] ACPI: Core revision 20180810
[    0.150335] Failed to register legacy timer interrupt
[    0.150336] APIC: Switch to symmetric I/O mode setup
[    0.150350] Hyper-V: Using IPI hypercalls
[    0.150353] clocksource: hyperv_clocksource_tsc_page: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.150397] Calibrating delay loop (skipped), value calculated using timer frequency.. 2995.20 BogoMIPS (lpj=14976020)
[    0.150414] pid_max: default: 32768 minimum: 301
[    0.150428] Security Framework initialized
[    0.150439] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.150443] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.150745] x86/cpu: Activated the Intel User Mode Instruction Prevention (UMIP) CPU feature
[    0.150753] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.150754] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.150755] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.150756] Spectre V2 : Mitigation: Enhanced IBRS
[    0.150756] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.150773] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.150774] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl and seccomp
[    0.151047] Freeing SMP alternatives memory: 44K
[    0.151831] smpboot: CPU0: Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (family: 0x6, model: 0x7e, stepping: 0x5)
[    0.151869] Performance Events: unsupported p6 CPU model 126 no PMU driver, software events only.
[    0.151885] rcu: Hierarchical SRCU implementation.
[    0.151998] random: crng done (trusting CPU's manufacturer)
[    0.152275] smp: Bringing up secondary CPUs ...
[    0.152307] x86: Booting SMP configuration:
[    0.152308] .... node  #0, CPUs:      #1
[    0.010189] x86/cpu: Activated the Intel User Mode Instruction Prevention (UMIP) CPU feature
[    0.152605]  #2
[    0.010189] x86/cpu: Activated the Intel User Mode Instruction Prevention (UMIP) CPU feature
[    0.152605]  #3
[    0.010189] x86/cpu: Activated the Intel User Mode Instruction Prevention (UMIP) CPU feature
[    0.152605]  #4
[    0.010189] x86/cpu: Activated the Intel User Mode Instruction Prevention (UMIP) CPU feature
[    0.152605] smp: Brought up 1 node, 5 CPUs
[    0.152605] smpboot: Max logical packages: 1
[    0.152605] smpboot: Total of 5 processors activated (14976.02 BogoMIPS)
[    0.152605] devtmpfs: initialized
[    0.152605] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.152605] futex hash table entries: 2048 (order: 5, 131072 bytes)
[    0.152605] xor: automatically using best checksumming function   avx       
[    0.152605] NET: Registered protocol family 16
[    0.152605] ACPI: bus type PCI registered
[    0.152605] PCI: Fatal: No config space access function found
[    0.152605] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.152605] raid6: Forced to use recovery algorithm avx2x2
[    0.152605] raid6: Forced gen() algo avx2x4
[    0.152605] ACPI: Added _OSI(Module Device)
[    0.152605] ACPI: Added _OSI(Processor Device)
[    0.152605] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.152605] ACPI: Added _OSI(Processor Aggregator Device)
[    0.152605] ACPI: Added _OSI(Linux-Dell-Video)
[    0.152605] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[    0.164361] ACPI: 1 ACPI AML tables successfully acquired and loaded
[    0.165021] ACPI: Interpreter enabled
[    0.165021] ACPI: (supports S0 S5)
[    0.165021] ACPI: Using IOAPIC for interrupt routing
[    0.165021] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.165021] ACPI: Enabled 2 GPEs in block 00 to 0F
[    0.165045] SCSI subsystem initialized
[    0.165045] hv_vmbus: Vmbus version:5.0
[    0.165045] PCI: Using ACPI for IRQ routing
[    0.165045] PCI: System does not support PCI
[    0.165045] clocksource: Switched to clocksource hyperv_clocksource_tsc_page
[    0.165045] hv_vmbus: Unknown GUID: c376c1c3-d276-48d2-90a9-c04748072c60
[    0.171236] VFS: Disk quotas dquot_6.6.0
[    0.171246] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.171281] FS-Cache: Loaded
[    0.171305] pnp: PnP ACPI init
[    0.171443] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)
[    0.171458] pnp: PnP ACPI: found 1 devices
[    0.177307] NET: Registered protocol family 2
[    0.177407] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes)
[    0.177411] TCP established hash table entries: 32768 (order: 6, 262144 bytes)
[    0.177431] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)
[    0.177460] TCP: Hash tables configured (established 32768 bind 32768)
[    0.177726] UDP hash table entries: 2048 (order: 4, 65536 bytes)
[    0.177732] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
[    0.177754] NET: Registered protocol family 1
[    0.178324] RPC: Registered named UNIX socket transport module.
[    0.178324] RPC: Registered udp transport module.
[    0.178325] RPC: Registered tcp transport module.
[    0.178325] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.178327] PCI: CLS 0 bytes, default 64
[    0.178667] Trying to unpack rootfs image as initramfs...
[    0.178936] Freeing initrd memory: 64K
[    0.178939] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.178940] software IO TLB: mapped [mem 0xf4000000-0xf8000000] (64MB)
[    0.179019] kvm: no hardware support
[    0.179020] has_svm: not amd
[    0.179021] kvm: no hardware support
[    0.179463] Initialise system trusted keyrings
[    0.179770] workingset: timestamp_bits=46 max_order=20 bucket_order=0
[    0.180424] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.180731] NFS: Registering the id_resolver key type
[    0.180734] Key type id_resolver registered
[    0.180734] Key type id_legacy registered
[    0.180736] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.181439] Key type cifs.idmap registered
[    0.181590] fuse init (API version 7.27)
[    0.181921] SGI XFS with ACLs, security attributes, realtime, scrub, no debug enabled
[    0.182677] 9p: Installing v9fs 9p2000 file system support
[    0.182683] FS-Cache: Netfs '9p' registered for caching
[    0.182711] FS-Cache: Netfs 'ceph' registered for caching
[    0.182713] ceph: loaded (mds proto 32)
[    0.188126] NET: Registered protocol family 38
[    0.188129] Key type asymmetric registered
[    0.188130] Asymmetric key parser 'x509' registered
[    0.188142] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.188144] io scheduler noop registered (default)
[    0.188392] hv_vmbus: registering driver hv_pci
[    0.188522] ACPI: AC Adapter [AC1] (on-line)
[    0.188741] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.189047] Non-volatile memory driver v1.3
[    0.189173] battery: ACPI: Battery Slot [BAT1] (battery present)
[    0.191021] brd: module loaded
[    0.191770] loop: module loaded
[    0.191872] hv_vmbus: registering driver hv_storvsc
[    0.191911] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[    0.192241] tun: Universal TUN/TAP device driver, 1.6
[    0.192594] PPP generic driver version 2.4.2
[    0.192663] PPP BSD Compression module registered
[    0.192664] PPP Deflate Compression module registered
[    0.192667] PPP MPPE Compression module registered
[    0.192667] NET: Registered protocol family 24
[    0.192671] hv_vmbus: registering driver hv_netvsc
[    0.195158] scsi host0: storvsc_host_t
[    0.202609] VFIO - User Level meta-driver version: 0.3
[    0.202830] hv_vmbus: registering driver hyperv_keyboard
[    0.203167] rtc_cmos 00:00: RTC can wake from S4
[    0.204737] rtc_cmos 00:00: registered as rtc0
[    0.204754] rtc_cmos 00:00: alarms up to one month, 114 bytes nvram
[    0.204921] device-mapper: ioctl: 4.39.0-ioctl (2018-04-03) initialised: dm-devel@redhat.com
[    0.205255] hv_utils: Registering HyperV Utility Driver
[    0.205256] hv_vmbus: registering driver hv_util
[    0.205295] hv_vmbus: registering driver hv_balloon
[    0.205307] hv_utils: cannot register PTP clock: 0
[    0.205327] dxgk:err: dxg_drv_init  Version: 1
[    0.205335] hv_vmbus: registering driver dxgkrnl
[    0.205380] drop_monitor: Initializing network drop monitor service
[    0.205860] hv_utils: TimeSync IC version 4.0
[    0.205979] hv_balloon: Using Dynamic Memory protocol version 2.0
[    0.206428] hv_balloon: cold memory discard enabled
[    0.209658] Mirror/redirect action on
[    0.210204] IPVS: Registered protocols (TCP, UDP)
[    0.210216] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[    0.211092] IPVS: ipvs loaded.
[    0.211094] IPVS: [rr] scheduler registered.
[    0.211094] IPVS: [wrr] scheduler registered.
[    0.211095] IPVS: [sh] scheduler registered.
[    0.212400] ipt_CLUSTERIP: ClusterIP Version 0.8 loaded successfully
[    0.212687] Initializing XFRM netlink socket
[    0.212802] NET: Registered protocol family 10
[    0.213883] Segment Routing with IPv6
[    0.215602] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    0.215689] NET: Registered protocol family 17
[    0.215702] Bridge firewalling registered
[    0.215708] 8021q: 802.1Q VLAN Support v1.8
[    0.215723] sctp: Hash tables configured (bind 256/256)
[    0.215767] 9pnet: Installing 9P2000 support
[    0.215777] Key type dns_resolver registered
[    0.215783] Key type ceph registered
[    0.216018] libceph: loaded (mon/osd proto 15/24)
[    0.216019] hv_vmbus: registering driver hv_sock
[    0.216098] NET: Registered protocol family 40
[    0.216363] registered taskstats version 1
[    0.216369] Loading compiled-in X.509 certificates
[    0.216567] Btrfs loaded, crc32c=crc32c-generic
[    0.217047] rtc_cmos 00:00: setting system clock to 2021-01-05 13:36:30 UTC (1609853790)
[    0.217062] Unstable clock detected, switching default tracing clock to "global"
               If you want to keep using the local clock, then add:
                 "trace_clock=local"
               on the kernel command line
[    0.220133] Freeing unused kernel image memory: 1512K
[    0.280824] Write protecting the kernel read-only data: 20480k
[    0.282026] Freeing unused kernel image memory: 1984K
[    0.282388] Freeing unused kernel image memory: 1240K
[    0.282390] Run /init as init process
[    0.457958] scsi 0:0:0:0: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    0.458498] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    0.458831] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    0.459313] sd 0:0:0:0: [sda] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[    0.459314] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    0.459405] sd 0:0:0:0: [sda] Write Protect is off
[    0.459407] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[    0.460049] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.462793] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.469846] scsi 0:0:0:1: Direct-Access     Msft     Virtual Disk     1.0  PQ: 0 ANSI: 5
[    0.470193] sd 0:0:0:1: Attached scsi generic sg1 type 0
[    0.471263] sd 0:0:0:1: [sdb] 536870912 512-byte logical blocks: (275 GB/256 GiB)
[    0.471265] sd 0:0:0:1: [sdb] 4096-byte physical blocks
[    0.471421] sd 0:0:0:1: [sdb] Write Protect is off
[    0.471423] sd 0:0:0:1: [sdb] Mode Sense: 0f 00 00 00
[    0.471621] sd 0:0:0:1: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.474671] sd 0:0:0:1: [sdb] Attached SCSI disk
[    0.479975] EXT4-fs (sda): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
[    0.502733] EXT4-fs warning (device sdb): ext4_clear_journal_err:5056: Filesystem error recorded from previous mount: IO failure
[    0.502734] EXT4-fs warning (device sdb): ext4_clear_journal_err:5057: Marking fs in need of filesystem check.
[    0.504352] Adding 1048576k swap on /swap/file.  Priority:-2 extents:1 across:1048576k 
[    0.506686] EXT4-fs (sdb): warning: mounting unchecked fs, running e2fsck is recommended
[    0.509323] EXT4-fs (sdb): recovery complete
[    0.510437] EXT4-fs (sdb): mounted filesystem with ordered data mode. Opts: discard,errors=remount-ro,data=ordered
[    1.270622] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   49.069001] hv_balloon: Max. dynamic memory size: 4096 MB
[   61.459944] WSL2: Performing memory compaction.
[   72.147086] EXT4-fs error (device sdb): ext4_validate_block_bitmap:384: comm kworker/u10:1: bg 109: bad block bitmap checksum
[   72.198226] Aborting journal on device sdb-8.
[   72.200092] EXT4-fs (sdb): Remounting filesystem read-only
[  122.513198] WSL2: Performing memory compaction.
[  183.555787] WSL2: Performing memory compaction.
[  244.566958] WSL2: Performing memory compaction.
[  305.270494] EXT4-fs (sdb): error count since last fsck: 190
[  305.270498] EXT4-fs (sdb): initial error at time 1609409853: ext4_validate_block_bitmap:384
[  305.270501] EXT4-fs (sdb): last error at time 1609853862: ext4_validate_block_bitmap:384: inode 45321
[  305.579120] WSL2: Performing memory compaction.

WSL logs: https://aka.ms/AAar55x

Expected behavior

Copy either work or fail without making the whole fs read only.

Actual behavior

Failed operation result in read only file system

0xbadfca11 commented 3 years ago

Your Linux filesystem has corrupted. Do

sudo mount -o remount,ro /dev/sdb
sudo e2fsck -p /dev/sdb
wsl.exe --shutdown
guillotjulien commented 3 years ago

That wasn't enough to resolve the issue (same problem happen after executing the commands), however, e2fsck prompted to use fsck to resolve bad blocks, which I did, and it seems to have resolved the issue.

YmirWang commented 5 months ago

This seems to be consistent with the problem I encountered. When encountering this problem, even if it is restarted, the problem will still occur and cannot be recovered. Do you have the above solution later and how to avoid this problem from happening?

BTW:My Linux kernel version is also 4.19.275

YmirWang commented 5 months ago

run fsck, e2fsck,fsck.ext4, none of these can solve the problem. EXT4-fs error (device flash-protect-rw): ext4_validate_block_bitmap:384: comm PsmSsp: bg 0: bad block bitmap checksum EXT4-fs (flash-protect-rw): Delayed block allocation failed for inode 12 at logical offset 0 with max blocks 1 with error 74 EXT4-fs (flash-protect-rw): This should not happen!! Data will be lost