xfstests generic/476 failed on btrfs(errno=-12 Out of memory, kernel 5.11.10)
Subsystems (2)
Hi,
xfstests generic/476 failed on btrfs(errno=-12 Out of memory, kernel 5.11.10)
The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swap kernel config: see the file config-5.11.10-1
# cat /ssd/git/os/xfstests/results//generic/476.dmesg [ 4890.430304] run fstests generic/476 at 2021-03-26 19:02:17 [ 4890.634292] BTRFS info (device nvme0n1p1): using free space tree [ 4890.634303] BTRFS info (device nvme0n1p1): has skinny extents [ 4890.636509] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 4890.697326] BTRFS: device fsid e9634b28-1ede-4e14-bb0b-18226e5858d0 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2635285) [ 4890.711959] BTRFS info (device sdb1): using free space tree [ 4890.711967] BTRFS info (device sdb1): has skinny extents [ 4890.711971] BTRFS info (device sdb1): flagging fs with big metadata feature [ 4890.713813] BTRFS info (device sdb1): enabling ssd optimizations [ 4890.713993] BTRFS info (device sdb1): cleaning free space cache v1 [ 4890.714664] BTRFS info (device sdb1): checking UUID tree [ 5071.783374] ------------[ cut here ]------------ [ 5071.783387] BTRFS: Transaction aborted (error -12) [ 5071.783452] WARNING: CPU: 38 PID: 2635321 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783529] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek snd_hda_codec_generic sb_edac x86_pkg_temp_thermal snd_hda_codec_hdmi ledtrig_audio intel_powerclamp coretemp dcdbas kvm_intel snd_hda_intel mei_wdt snd_intel_dspcfg iTCO_wdt iTCO_vendor_support dell_smm_hwmon snd_hda_codec kvm snd_hda_core snd_hwdep snd_seq snd_seq_device irqbypass snd_pcm rapl intel_cstate snd_timer mei_me snd intel_uncore i2c_i801 pcspkr mei lpc_ich i2c_smbus soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt rdma_rxe nfsd ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_ttm_he lper [ 5071.783605] ttm bnx2x drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm crct10dif_pclmul crc32_pclmul mpt3sas crc32c_intel ahci libahci nvme e1000e ghash_clmulni_intel libata mdio nvme_core raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5071.783658] CPU: 38 PID: 2635321 Comm: fsstress Tainted: G S W 5.11.10-1.el8.x86_64 #1 [ 5071.783664] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5071.783668] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783719] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 60 54 c0 48 89 85 78 ff ff ff e8 98 03 ee cf <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 76 53 [ 5071.783726] RSP: 0018:ffffb090a46cfb00 EFLAGS: 00010286 [ 5071.783730] RAX: 0000000000000000 RBX: ffff8ec518ef60d0 RCX: 0000000000000027 [ 5071.783734] RDX: 0000000000000027 RSI: ffff8ed4afc97d80 RDI: ffff8ed4afc97d88 [ 5071.783737] RBP: ffffb090a46cfbd0 R08: 0000000000000000 R09: c0000000ffff7fff [ 5071.783740] R10: 0000000000000001 R11: ffffb090a46cf908 R12: ffff8ea6284be240 [ 5071.783743] R13: ffff8ec519783400 R14: ffff8ec4fa591800 R15: 00000000fffffff4 [ 5071.783747] FS: 00007fe2123fc000(0000) GS:ffff8ed4afc80000(0000) knlGS:0000000000000000 [ 5071.783751] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5071.783754] CR2: 00007fe2123fa000 CR3: 000000010f866002 CR4: 00000000001706e0 [ 5071.783758] Call Trace: [ 5071.783767] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783817] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783889] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5071.783939] ? btrfs_record_root_in_trans+0x56/0x60 [btrfs] [ 5071.783987] ? finish_wait+0x80/0x80 [ 5071.783994] btrfs_mksubvol+0x2b0/0x440 [btrfs] [ 5071.784058] btrfs_mksnapshot+0x75/0xa0 [btrfs] [ 5071.784120] __btrfs_ioctl_snap_create+0x167/0x170 [btrfs] [ 5071.784181] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5071.784241] btrfs_ioctl+0xb9e/0x2f30 [btrfs] [ 5071.784303] ? __x64_sys_ioctl+0x84/0xc0 [ 5071.784310] __x64_sys_ioctl+0x84/0xc0 [ 5071.784317] do_syscall_64+0x33/0x40 [ 5071.784325] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5071.784334] RIP: 0033:0x7fe2116f388b [ 5071.784339] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5071.784344] RSP: 002b:00007fffa709dfe8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5071.784349] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe2116f388b [ 5071.784352] RDX: 00007fffa709f010 RSI: 0000000050009417 RDI: 0000000000000005 [ 5071.784356] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 [ 5071.784359] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 [ 5071.784362] R13: 00007fffa70a0060 R14: 0000000000000005 R15: 0000000000000005 [ 5071.784367] ---[ end trace 1b8c9453a855d694 ]--- [ 5071.784376] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5071.784382] BTRFS info (device sdb1): forced readonly [ 5071.784388] btrfs_printk: 72 callbacks suppressed [ 5071.784389] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5071.784395] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5083.887607] BTRFS info (device sdb1): using free space tree [ 5083.887619] BTRFS info (device sdb1): has skinny extents [ 5083.897508] BTRFS info (device sdb1): enabling ssd optimizations [ 5083.962955] BTRFS info (device sdb1): checking UUID tree
xfstest (check) is easy than xfstest (check generic/476) to reproduce this problem.
CONFIG_PGTABLE_LEVELS=4 in config-5.11.10-1 , so we test it again in CONFIG_PGTABLE_LEVELS=5, this problem happened too.
[ 5517.540314] run fstests generic/476 at 2021-03-26 22:44:25 [ 5517.749126] BTRFS info (device nvme0n1p1): using free space tree [ 5517.750050] BTRFS info (device nvme0n1p1): has skinny extents [ 5517.753372] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 5517.817411] BTRFS: device fsid d45acee6-3d3c-44d9-88be-46edd236b457 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2645359) [ 5517.832014] BTRFS info (device sdb1): using free space tree [ 5517.833034] BTRFS info (device sdb1): has skinny extents [ 5517.834032] BTRFS info (device sdb1): flagging fs with big metadata feature [ 5517.836874] BTRFS info (device sdb1): enabling ssd optimizations [ 5517.838057] BTRFS info (device sdb1): cleaning free space cache v1 [ 5517.839759] BTRFS info (device sdb1): checking UUID tree [ 5665.863820] ------------[ cut here ]------------ [ 5665.865301] BTRFS: Transaction aborted (error -12) [ 5665.865372] WARNING: CPU: 34 PID: 2645395 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.866756] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek sb_edac snd_hda_codec_generic snd_hda_codec_hdmi ledtrig_audio x86_pkg_temp_thermal intel_powerclamp snd_hda_intel coretemp snd_intel_dspcfg kvm_intel snd_hda_codec snd_hda_core dcdbas iTCO_wdt mei_wdt iTCO_vendor_support dell_smm_hwmon snd_hwdep kvm snd_seq snd_seq_device snd_pcm irqbypass rapl snd_timer intel_cstate snd intel_uncore mei_me i2c_i801 pcspkr i2c_smbus mei lpc_ich soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt nfsd rdma_rxe ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_ttm_he lper [ 5665.866851] ttm drm_kms_helper bnx2x syscopyarea sysfillrect sysimgblt fb_sys_fops cec ahci crct10dif_pclmul libahci crc32_pclmul nvme crc32c_intel drm mpt3sas libata e1000e ghash_clmulni_intel nvme_core mdio raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5665.882765] CPU: 34 PID: 2645395 Comm: fsstress Tainted: G S 5.11.10-2.el8.x86_64 #1 [ 5665.884634] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5665.886592] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.888599] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 20 3c c0 48 89 85 78 ff ff ff e8 50 86 46 f0 <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 36 3b [ 5665.892739] RSP: 0018:ffffb82ee81ffa60 EFLAGS: 00010286 [ 5665.894863] RAX: 0000000000000000 RBX: ffff9ffcf0aae6e8 RCX: 0000000000000027 [ 5665.897001] RDX: 0000000000000027 RSI: ffffa00b6fb97d80 RDI: ffffa00b6fb97d88 [ 5665.899160] RBP: ffffb82ee81ffb30 R08: 0000000000000000 R09: c0000000ffff7fff [ 5665.901363] R10: 0000000000000001 R11: ffffb82ee81ff868 R12: ffff9ffc825fb800 [ 5665.903556] R13: ffff9ffbdb759800 R14: ffff9fdeb761c000 R15: 00000000fffffff4 [ 5665.905765] FS: 00007f8100d50000(0000) GS:ffffa00b6fb80000(0000) knlGS:0000000000000000 [ 5665.908029] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5665.910285] CR2: 0000000001c83638 CR3: 00000004e3ab0002 CR4: 00000000001706e0 [ 5665.912575] Call Trace: [ 5665.914870] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.917249] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.919583] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5665.921945] ? btrfs_block_rsv_release+0xe2/0x2a0 [btrfs] [ 5665.924319] ? finish_wait+0x80/0x80 [ 5665.926664] create_subvol+0x4ef/0x8c0 [btrfs] [ 5665.929056] btrfs_mksubvol+0x36e/0x440 [btrfs] [ 5665.931441] ? path_openat+0x638/0xfd0 [ 5665.933758] __btrfs_ioctl_snap_create+0x11c/0x170 [btrfs] [ 5665.936077] ? _copy_from_user+0x3a/0x70 [ 5665.938337] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5665.940657] btrfs_ioctl+0x9b0/0x2f30 [btrfs] [ 5665.943001] ? tick_sched_handle.isra.23+0x1f/0x60 [ 5665.945275] ? __x64_sys_ioctl+0x84/0xc0 [ 5665.947526] __x64_sys_ioctl+0x84/0xc0 [ 5665.949756] do_syscall_64+0x33/0x40 [ 5665.951992] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5665.954230] RIP: 0033:0x7f810004188b [ 5665.956396] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5665.961062] RSP: 002b:00007fff3bbbe388 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5665.963468] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f810004188b [ 5665.965863] RDX: 00007fff3bbbe390 RSI: 0000000050009418 RDI: 0000000000000004 [ 5665.968236] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000006 [ 5665.970649] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005 [ 5665.973027] R13: 0000000000404d60 R14: 0000000000000000 R15: 0000000000000000 [ 5665.975416] ---[ end trace 648a28c0cc4e3cd4 ]--- [ 5665.977818] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5665.980170] BTRFS info (device sdb1): forced readonly [ 5665.982528] btrfs_printk: 241 callbacks suppressed [ 5665.982531] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5665.987121] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5678.073600] BTRFS info (device sdb1): using free space tree [ 5678.075716] BTRFS info (device sdb1): has skinny extents [ 5678.086808] BTRFS info (device sdb1): enabling ssd optimizations [ 5678.146553] BTRFS info (device sdb1): checking UUID tree
It is not clear whether it is a btrfs problem or a linux mm problem. but firstly report it as btrfs problem.
Best Regards
Wang Yugui ([email protected])
2021/03/26
Hi,
SSD/SAS is easy than SSD/NVMe to reproduce this problem.
Yet not able to reproduce this problem on another server.
CPU: Xeon(R) CPU E5-2680 v2(10 core) *2 memory: 192G, no swap disk: SSD/NVMe with same partition size as SSD/SAS.
And this problem happened in kernel 5.10.26 + btrfs backport from 5.12.0-rc4 with a different callstack.
[10459.782442] run fstests generic/476 at 2021-03-27 15:02:14 [10459.988507] BTRFS info (device nvme0n1p1): has skinny extents [10459.988515] BTRFS info (device nvme0n1p1): using free space tree [10459.991086] BTRFS info (device nvme0n1p1): enabling ssd optimizations [10460.062565] BTRFS: device fsid 776508dd-165d-4150-89a9-0cdd13a0004a devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2713399) [10460.075938] BTRFS info (device sdb1): has skinny extents [10460.075947] BTRFS info (device sdb1): flagging fs with big metadata feature [10460.075950] BTRFS info (device sdb1): using free space tree [10460.077791] BTRFS info (device sdb1): enabling ssd optimizations [10460.078662] BTRFS info (device sdb1): checking UUID tree [10604.622052] ------------[ cut here ]------------ [10604.622062] BTRFS: Transaction aborted (error -12) [10604.622182] WARNING: CPU: 10 PID: 2713438 at fs/btrfs/ioctl.c:718 create_subvol+0x888/0x8f0 [btrfs] [10604.622187] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_flakey loop rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi intel_rapl_msr intel_rapl_common snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation snd_soc_core sb_edac x86_pkg_temp_thermal snd_compress iTCO_wdt intel_powerclamp intel_pmc_bxt snd_pcm_dmaengine coretemp soundwire_cadence mei_wdt mei_hdcp iTCO_vendor_support kvm_intel snd_hda_codec dcdbas dell_smm_hwmon snd_hda_core kvm ac97_bus snd_hwdep snd_seq snd_seq_device irqbypass snd_pcm rapl intel_cstate mei_me snd_timer i2c_i801 intel_uncore snd mei i2c_smbus lpc_ich soundcore nvme_rdma nvme_fabrics rdma_cm iw_cm ib_cm rdmavt rdma_rxe nfsd ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nf s_acl [10604.622244] lockd grace nfs_ssc ip_tables xfs radeon i2c_algo_bit bnx2x ttm drm_kms_helper cec crct10dif_pclmul crc32_pclmul crc32c_intel drm nvme mpt3sas e1000e pcspkr mdio ghash_clmulni_intel nvme_core raid_class scsi_transport_sas wmi dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua btrfs xor raid6_pq sunrpc i2c_dev [last unloaded: scsi_debug] [10604.622292] CPU: 10 PID: 2713438 Comm: fsstress Tainted: G S 5.10.26-3.el7.x86_64 #1 [10604.622296] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [10604.622333] RIP: 0010:create_subvol+0x888/0x8f0 [btrfs] [10604.622337] Code: 8b 40 50 f0 48 0f ba a8 50 0a 00 00 03 72 1d 41 83 ff fb 74 37 41 83 ff e2 74 31 44 89 fe 48 c7 c7 f0 44 59 c0 e8 ec 6b 5a f6 <0f> 0b 48 8b bd 30 ff ff ff 44 89 f9 ba ce 02 00 00 48 c7 c6 80 2a [10604.622342] RSP: 0018:ffffafd7326cfc08 EFLAGS: 00010286 [10604.622346] RAX: 0000000000000000 RBX: ffff9071a992ca00 RCX: 0000000000000027 [10604.622348] RDX: 0000000000000027 RSI: ffff90812f818a80 RDI: ffff90812f818a88 [10604.622351] RBP: ffffafd7326cfce8 R08: 0000000000000000 R09: c0000000ffffd1cc [10604.622354] R10: fffffffffffd00d0 R11: ffffafd7326cfa10 R12: 00000000fffffff4 [10604.622358] R13: ffff905445386000 R14: ffff9071e9b40230 R15: fffffffffffffff4 [10604.622361] FS: 00007fb9e7398000(0000) GS:ffff90812f800000(0000) knlGS:0000000000000000 [10604.622364] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [10604.622367] CR2: 00000000009c5c40 CR3: 000000020d826002 CR4: 00000000001706e0 [10604.622370] Call Trace: [10604.622411] btrfs_mksubvol+0x368/0x440 [btrfs] [10604.622447] __btrfs_ioctl_snap_create+0x11c/0x170 [btrfs] [10604.622455] ? _copy_from_user+0x3a/0x70 [10604.622488] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [10604.622522] btrfs_ioctl+0x9d5/0x2f80 [btrfs] [10604.622528] ? __handle_mm_fault+0x797/0x7c0 [10604.622534] ? __x64_sys_ioctl+0x84/0xc0 [10604.622536] __x64_sys_ioctl+0x84/0xc0 [10604.622542] do_syscall_64+0x33/0x40 [10604.622549] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [10604.622552] RIP: 0033:0x7fb9e668988b [10604.622556] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [10604.622561] RSP: 002b:00007fff461628b8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [10604.622565] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb9e668988b [10604.622569] RDX: 00007fff461628c0 RSI: 0000000050009418 RDI: 0000000000000004 [10604.622572] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000006 [10604.622575] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005 [10604.622577] R13: 0000000000404d60 R14: 0000000000000000 R15: 0000000000000000 [10604.622582] ---[ end trace ca8166c2db3ed522 ]--- [10604.622587] BTRFS: error (device sdb1) in create_subvol:718: errno=-12 Out of memory [10604.622591] BTRFS info (device sdb1): forced readonly [10617.634193] BTRFS info (device sdb1): has skinny extents [10617.634205] BTRFS info (device sdb1): using free space tree [10617.642932] BTRFS info (device sdb1): enabling ssd optimizations
fs/btrfs/ioctl.c:718
new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev);
if (IS_ERR(new_root)) {
free_anon_bdev(anon_dev);
ret = PTR_ERR(new_root);
btrfs_abort_transaction(trans, ret);
goto fail;
}Best Regards
Wang Yugui ([email protected])
2021/03/27
Quoted 9 lines
Hi,
xfstests generic/476 failed on
btrfs(errno=-12 Out of memory, kernel 5.11.10)The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swap kernel config: see the file config-5.11.10-1
Quoted 16 lines
# cat /ssd/git/os/xfstests/results//generic/476.dmesg [ 4890.430304] run fstests generic/476 at 2021-03-26 19:02:17 [ 4890.634292] BTRFS info (device nvme0n1p1): using free space tree [ 4890.634303] BTRFS info (device nvme0n1p1): has skinny extents [ 4890.636509] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 4890.697326] BTRFS: device fsid e9634b28-1ede-4e14-bb0b-18226e5858d0 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2635285) [ 4890.711959] BTRFS info (device sdb1): using free space tree [ 4890.711967] BTRFS info (device sdb1): has skinny extents [ 4890.711971] BTRFS info (device sdb1): flagging fs with big metadata feature [ 4890.713813] BTRFS info (device sdb1): enabling ssd optimizations [ 4890.713993] BTRFS info (device sdb1): cleaning free space cache v1 [ 4890.714664] BTRFS info (device sdb1): checking UUID tree [ 5071.783374] ------------[ cut here ]------------ [ 5071.783387] BTRFS: Transaction aborted (error -12) [ 5071.783452] WARNING: CPU: 38 PID: 2635321 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783529] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek snd_hda_codec_generic sb_edac x86_pkg_temp_thermal snd_hda_codec_hdmi ledtrig_audio intel_powerclamp coretemp dcdbas kvm_intel snd_hda_intel mei_wdt snd_intel_dspcfg iTCO_wdt iTCO_vendor_support dell_smm_hwmon snd_hda_codec kvm snd_hda_core snd_hwdep snd_seq snd_seq_device irqbypass snd_pcm rapl intel_cstate snd_timer mei_me snd intel_uncore i2c_i801 pcspkr mei lpc_ich i2c_smbus soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt rdma_rxe nfsd ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_ttm_
helper
Quoted 55 lines
[ 5071.783605] ttm bnx2x drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm crct10dif_pclmul crc32_pclmul mpt3sas crc32c_intel ahci libahci nvme e1000e ghash_clmulni_intel libata mdio nvme_core raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5071.783658] CPU: 38 PID: 2635321 Comm: fsstress Tainted: G S W 5.11.10-1.el8.x86_64 #1 [ 5071.783664] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5071.783668] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783719] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 60 54 c0 48 89 85 78 ff ff ff e8 98 03 ee cf <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 76 53 [ 5071.783726] RSP: 0018:ffffb090a46cfb00 EFLAGS: 00010286 [ 5071.783730] RAX: 0000000000000000 RBX: ffff8ec518ef60d0 RCX: 0000000000000027 [ 5071.783734] RDX: 0000000000000027 RSI: ffff8ed4afc97d80 RDI: ffff8ed4afc97d88 [ 5071.783737] RBP: ffffb090a46cfbd0 R08: 0000000000000000 R09: c0000000ffff7fff [ 5071.783740] R10: 0000000000000001 R11: ffffb090a46cf908 R12: ffff8ea6284be240 [ 5071.783743] R13: ffff8ec519783400 R14: ffff8ec4fa591800 R15: 00000000fffffff4 [ 5071.783747] FS: 00007fe2123fc000(0000) GS:ffff8ed4afc80000(0000) knlGS:0000000000000000 [ 5071.783751] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5071.783754] CR2: 00007fe2123fa000 CR3: 000000010f866002 CR4: 00000000001706e0 [ 5071.783758] Call Trace: [ 5071.783767] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783817] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783889] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5071.783939] ? btrfs_record_root_in_trans+0x56/0x60 [btrfs] [ 5071.783987] ? finish_wait+0x80/0x80 [ 5071.783994] btrfs_mksubvol+0x2b0/0x440 [btrfs] [ 5071.784058] btrfs_mksnapshot+0x75/0xa0 [btrfs] [ 5071.784120] __btrfs_ioctl_snap_create+0x167/0x170 [btrfs] [ 5071.784181] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5071.784241] btrfs_ioctl+0xb9e/0x2f30 [btrfs] [ 5071.784303] ? __x64_sys_ioctl+0x84/0xc0 [ 5071.784310] __x64_sys_ioctl+0x84/0xc0 [ 5071.784317] do_syscall_64+0x33/0x40 [ 5071.784325] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5071.784334] RIP: 0033:0x7fe2116f388b [ 5071.784339] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5071.784344] RSP: 002b:00007fffa709dfe8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5071.784349] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe2116f388b [ 5071.784352] RDX: 00007fffa709f010 RSI: 0000000050009417 RDI: 0000000000000005 [ 5071.784356] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 [ 5071.784359] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 [ 5071.784362] R13: 00007fffa70a0060 R14: 0000000000000005 R15: 0000000000000005 [ 5071.784367] ---[ end trace 1b8c9453a855d694 ]--- [ 5071.784376] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5071.784382] BTRFS info (device sdb1): forced readonly [ 5071.784388] btrfs_printk: 72 callbacks suppressed [ 5071.784389] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5071.784395] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5083.887607] BTRFS info (device sdb1): using free space tree [ 5083.887619] BTRFS info (device sdb1): has skinny extents [ 5083.897508] BTRFS info (device sdb1): enabling ssd optimizations [ 5083.962955] BTRFS info (device sdb1): checking UUID treexfstest (check) is easy than xfstest (check generic/476) to reproduce this problem.
CONFIG_PGTABLE_LEVELS=4in config-5.11.10-1 , so we test it again inCONFIG_PGTABLE_LEVELS=5, this problem happened too.
Quoted 15 lines
[ 5517.540314] run fstests generic/476 at 2021-03-26 22:44:25 [ 5517.749126] BTRFS info (device nvme0n1p1): using free space tree [ 5517.750050] BTRFS info (device nvme0n1p1): has skinny extents [ 5517.753372] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 5517.817411] BTRFS: device fsid d45acee6-3d3c-44d9-88be-46edd236b457 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2645359) [ 5517.832014] BTRFS info (device sdb1): using free space tree [ 5517.833034] BTRFS info (device sdb1): has skinny extents [ 5517.834032] BTRFS info (device sdb1): flagging fs with big metadata feature [ 5517.836874] BTRFS info (device sdb1): enabling ssd optimizations [ 5517.838057] BTRFS info (device sdb1): cleaning free space cache v1 [ 5517.839759] BTRFS info (device sdb1): checking UUID tree [ 5665.863820] ------------[ cut here ]------------ [ 5665.865301] BTRFS: Transaction aborted (error -12) [ 5665.865372] WARNING: CPU: 34 PID: 2645395 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.866756] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek sb_edac snd_hda_codec_generic snd_hda_codec_hdmi ledtrig_audio x86_pkg_temp_thermal intel_powerclamp snd_hda_intel coretemp snd_intel_dspcfg kvm_intel snd_hda_codec snd_hda_core dcdbas iTCO_wdt mei_wdt iTCO_vendor_support dell_smm_hwmon snd_hwdep kvm snd_seq snd_seq_device snd_pcm irqbypass rapl snd_timer intel_cstate snd intel_uncore mei_me i2c_i801 pcspkr i2c_smbus mei lpc_ich soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt nfsd rdma_rxe ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_ttm_
helper
Quoted 58 lines
[ 5665.866851] ttm drm_kms_helper bnx2x syscopyarea sysfillrect sysimgblt fb_sys_fops cec ahci crct10dif_pclmul libahci crc32_pclmul nvme crc32c_intel drm mpt3sas libata e1000e ghash_clmulni_intel nvme_core mdio raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5665.882765] CPU: 34 PID: 2645395 Comm: fsstress Tainted: G S 5.11.10-2.el8.x86_64 #1 [ 5665.884634] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5665.886592] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.888599] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 20 3c c0 48 89 85 78 ff ff ff e8 50 86 46 f0 <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 36 3b [ 5665.892739] RSP: 0018:ffffb82ee81ffa60 EFLAGS: 00010286 [ 5665.894863] RAX: 0000000000000000 RBX: ffff9ffcf0aae6e8 RCX: 0000000000000027 [ 5665.897001] RDX: 0000000000000027 RSI: ffffa00b6fb97d80 RDI: ffffa00b6fb97d88 [ 5665.899160] RBP: ffffb82ee81ffb30 R08: 0000000000000000 R09: c0000000ffff7fff [ 5665.901363] R10: 0000000000000001 R11: ffffb82ee81ff868 R12: ffff9ffc825fb800 [ 5665.903556] R13: ffff9ffbdb759800 R14: ffff9fdeb761c000 R15: 00000000fffffff4 [ 5665.905765] FS: 00007f8100d50000(0000) GS:ffffa00b6fb80000(0000) knlGS:0000000000000000 [ 5665.908029] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5665.910285] CR2: 0000000001c83638 CR3: 00000004e3ab0002 CR4: 00000000001706e0 [ 5665.912575] Call Trace: [ 5665.914870] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.917249] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.919583] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5665.921945] ? btrfs_block_rsv_release+0xe2/0x2a0 [btrfs] [ 5665.924319] ? finish_wait+0x80/0x80 [ 5665.926664] create_subvol+0x4ef/0x8c0 [btrfs] [ 5665.929056] btrfs_mksubvol+0x36e/0x440 [btrfs] [ 5665.931441] ? path_openat+0x638/0xfd0 [ 5665.933758] __btrfs_ioctl_snap_create+0x11c/0x170 [btrfs] [ 5665.936077] ? _copy_from_user+0x3a/0x70 [ 5665.938337] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5665.940657] btrfs_ioctl+0x9b0/0x2f30 [btrfs] [ 5665.943001] ? tick_sched_handle.isra.23+0x1f/0x60 [ 5665.945275] ? __x64_sys_ioctl+0x84/0xc0 [ 5665.947526] __x64_sys_ioctl+0x84/0xc0 [ 5665.949756] do_syscall_64+0x33/0x40 [ 5665.951992] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5665.954230] RIP: 0033:0x7f810004188b [ 5665.956396] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5665.961062] RSP: 002b:00007fff3bbbe388 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5665.963468] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f810004188b [ 5665.965863] RDX: 00007fff3bbbe390 RSI: 0000000050009418 RDI: 0000000000000004 [ 5665.968236] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000006 [ 5665.970649] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005 [ 5665.973027] R13: 0000000000404d60 R14: 0000000000000000 R15: 0000000000000000 [ 5665.975416] ---[ end trace 648a28c0cc4e3cd4 ]--- [ 5665.977818] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5665.980170] BTRFS info (device sdb1): forced readonly [ 5665.982528] btrfs_printk: 241 callbacks suppressed [ 5665.982531] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5665.987121] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5678.073600] BTRFS info (device sdb1): using free space tree [ 5678.075716] BTRFS info (device sdb1): has skinny extents [ 5678.086808] BTRFS info (device sdb1): enabling ssd optimizations [ 5678.146553] BTRFS info (device sdb1): checking UUID treeIt is not clear whether it is a btrfs problem or a linux mm problem. but firstly report it as btrfs problem.
Best Regards
Wang Yugui ([email protected])
2021/03/26
Hi,
these callstack have a same root failure.
struct btrfs_path *btrfs_alloc_path(void)
{
return kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS);
}fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs]
(fail)new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev); (fail)btrfs_get_root_ref (fail)btrfs_alloc_path
fs/btrfs/ioctl.c:718 create_subvol+0x888/0x8f0 [btrfs]
(fail)new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev); (fail)btrfs_get_root_ref (fail)btrfs_alloc_path
Any advice whether it is a btrfs usage problem , or linux mm implement problem, or expected behavior ?
this server has 192G memory and no swap.
/etc/sysctl.conf
#10G/1G
vm.dirty_bytes=10737418240
vm.dirty_background_bytes=1073741824
And the filesystem is 10GiB
# cat /usr/hpc-bio/xfstests/results//generic/476.full btrfs-progs v5.10.1 See http://btrfs.wiki.kernel.org for more information.
Detected a SSD, turning off metadata duplication. Mkfs with -m dup if you want to force metadata duplication.
Label: (null)
UUID: 776508dd-165d-4150-89a9-0cdd13a0004a
Node size: 16384
Sector size: 4096
Filesystem size: 10.00GiB
Block group profiles:
Data: single 8.00MiB
Metadata: single 8.00MiB
System: single 4.00MiB
SSD detected: yes
Incompat features: extref, skinny-metadata, no-holes
Runtime features: free-space-tree
Checksum: crc32c
Number of devices: 1
Devices:
ID SIZE PATH
1 10.00GiB /dev/sdb1Best Regards
Wang Yugui ([email protected])
2021/03/27
Quoted 13 lines
Hi,
SSD/SAS is easy than SSD/NVMe to reproduce this problem.
Yet not able to reproduce this problem on another server.
CPU: Xeon(R) CPU E5-2680 v2(10 core) *2 memory: 192G, no swap disk: SSD/NVMe with same partition size as SSD/SAS.And this problem happened in kernel 5.10.26 + btrfs backport from 5.12.0-rc4 with a different callstack.
Quoted 14 lines
[10459.782442] run fstests generic/476 at 2021-03-27 15:02:14 [10459.988507] BTRFS info (device nvme0n1p1): has skinny extents [10459.988515] BTRFS info (device nvme0n1p1): using free space tree [10459.991086] BTRFS info (device nvme0n1p1): enabling ssd optimizations [10460.062565] BTRFS: device fsid 776508dd-165d-4150-89a9-0cdd13a0004a devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2713399) [10460.075938] BTRFS info (device sdb1): has skinny extents [10460.075947] BTRFS info (device sdb1): flagging fs with big metadata feature [10460.075950] BTRFS info (device sdb1): using free space tree [10460.077791] BTRFS info (device sdb1): enabling ssd optimizations [10460.078662] BTRFS info (device sdb1): checking UUID tree [10604.622052] ------------[ cut here ]------------ [10604.622062] BTRFS: Transaction aborted (error -12) [10604.622182] WARNING: CPU: 10 PID: 2713438 at fs/btrfs/ioctl.c:718 create_subvol+0x888/0x8f0 [btrfs] [10604.622187] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_flakey loop rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi intel_rapl_msr intel_rapl_common snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation snd_soc_core sb_edac x86_pkg_temp_thermal snd_compress iTCO_wdt intel_powerclamp intel_pmc_bxt snd_pcm_dmaengine coretemp soundwire_cadence mei_wdt mei_hdcp iTCO_vendor_support kvm_intel snd_hda_codec dcdbas dell_smm_hwmon snd_hda_core kvm ac97_bus snd_hwdep snd_seq snd_seq_device irqbypass snd_pcm rapl intel_cstate mei_me snd_timer i2c_i801 intel_uncore snd mei i2c_smbus lpc_ich soundcore nvme_rdma nvme_fabrics rdma_cm iw_cm ib_cm rdmavt rdma_rxe nfsd ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss
nfs_acl
Quoted 52 lines
[10604.622244] lockd grace nfs_ssc ip_tables xfs radeon i2c_algo_bit bnx2x ttm drm_kms_helper cec crct10dif_pclmul crc32_pclmul crc32c_intel drm nvme mpt3sas e1000e pcspkr mdio ghash_clmulni_intel nvme_core raid_class scsi_transport_sas wmi dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua btrfs xor raid6_pq sunrpc i2c_dev [last unloaded: scsi_debug] [10604.622292] CPU: 10 PID: 2713438 Comm: fsstress Tainted: G S 5.10.26-3.el7.x86_64 #1 [10604.622296] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [10604.622333] RIP: 0010:create_subvol+0x888/0x8f0 [btrfs] [10604.622337] Code: 8b 40 50 f0 48 0f ba a8 50 0a 00 00 03 72 1d 41 83 ff fb 74 37 41 83 ff e2 74 31 44 89 fe 48 c7 c7 f0 44 59 c0 e8 ec 6b 5a f6 <0f> 0b 48 8b bd 30 ff ff ff 44 89 f9 ba ce 02 00 00 48 c7 c6 80 2a [10604.622342] RSP: 0018:ffffafd7326cfc08 EFLAGS: 00010286 [10604.622346] RAX: 0000000000000000 RBX: ffff9071a992ca00 RCX: 0000000000000027 [10604.622348] RDX: 0000000000000027 RSI: ffff90812f818a80 RDI: ffff90812f818a88 [10604.622351] RBP: ffffafd7326cfce8 R08: 0000000000000000 R09: c0000000ffffd1cc [10604.622354] R10: fffffffffffd00d0 R11: ffffafd7326cfa10 R12: 00000000fffffff4 [10604.622358] R13: ffff905445386000 R14: ffff9071e9b40230 R15: fffffffffffffff4 [10604.622361] FS: 00007fb9e7398000(0000) GS:ffff90812f800000(0000) knlGS:0000000000000000 [10604.622364] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [10604.622367] CR2: 00000000009c5c40 CR3: 000000020d826002 CR4: 00000000001706e0 [10604.622370] Call Trace: [10604.622411] btrfs_mksubvol+0x368/0x440 [btrfs] [10604.622447] __btrfs_ioctl_snap_create+0x11c/0x170 [btrfs] [10604.622455] ? _copy_from_user+0x3a/0x70 [10604.622488] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [10604.622522] btrfs_ioctl+0x9d5/0x2f80 [btrfs] [10604.622528] ? __handle_mm_fault+0x797/0x7c0 [10604.622534] ? __x64_sys_ioctl+0x84/0xc0 [10604.622536] __x64_sys_ioctl+0x84/0xc0 [10604.622542] do_syscall_64+0x33/0x40 [10604.622549] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [10604.622552] RIP: 0033:0x7fb9e668988b [10604.622556] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [10604.622561] RSP: 002b:00007fff461628b8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [10604.622565] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb9e668988b [10604.622569] RDX: 00007fff461628c0 RSI: 0000000050009418 RDI: 0000000000000004 [10604.622572] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000006 [10604.622575] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005 [10604.622577] R13: 0000000000404d60 R14: 0000000000000000 R15: 0000000000000000 [10604.622582] ---[ end trace ca8166c2db3ed522 ]--- [10604.622587] BTRFS: error (device sdb1) in create_subvol:718: errno=-12 Out of memory [10604.622591] BTRFS info (device sdb1): forced readonly [10617.634193] BTRFS info (device sdb1): has skinny extents [10617.634205] BTRFS info (device sdb1): using free space tree [10617.642932] BTRFS info (device sdb1): enabling ssd optimizations
fs/btrfs/ioctl.c:718new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev); if (IS_ERR(new_root)) { free_anon_bdev(anon_dev); ret = PTR_ERR(new_root); btrfs_abort_transaction(trans, ret); goto fail; }
Quoted 29 lines
Best Regards
Wang Yugui ([email protected])
2021/03/27Quoted 25 lines
Hi,
xfstests generic/476 failed on
btrfs(errno=-12 Out of memory, kernel 5.11.10)The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swap kernel config: see the file config-5.11.10-1# cat /ssd/git/os/xfstests/results//generic/476.dmesg [ 4890.430304] run fstests generic/476 at 2021-03-26 19:02:17 [ 4890.634292] BTRFS info (device nvme0n1p1): using free space tree [ 4890.634303] BTRFS info (device nvme0n1p1): has skinny extents [ 4890.636509] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 4890.697326] BTRFS: device fsid e9634b28-1ede-4e14-bb0b-18226e5858d0 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2635285) [ 4890.711959] BTRFS info (device sdb1): using free space tree [ 4890.711967] BTRFS info (device sdb1): has skinny extents [ 4890.711971] BTRFS info (device sdb1): flagging fs with big metadata feature [ 4890.713813] BTRFS info (device sdb1): enabling ssd optimizations [ 4890.713993] BTRFS info (device sdb1): cleaning free space cache v1 [ 4890.714664] BTRFS info (device sdb1): checking UUID tree [ 5071.783374] ------------[ cut here ]------------ [ 5071.783387] BTRFS: Transaction aborted (error -12) [ 5071.783452] WARNING: CPU: 38 PID: 2635321 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783529] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek snd_hda_codec_generic sb_edac x86_pkg_temp_thermal snd_hda_codec_hdmi ledtrig_audio intel_powerclamp coretemp dcdbas kvm_intel snd_hda_intel mei_wdt snd_intel_dspcfg iTCO_wdt iTCO_vendor_support dell_smm_hwmon snd_hda_codec kvm snd_hda_core snd_hwdep snd_seq snd_seq_device irqbypass snd_pcm rapl intel_cstate snd_timer mei_me snd intel_uncore i2c_i801 pcspkr mei lpc_ich i2c_smbus soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt rdma_rxe nfsd ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_tt
m_helper
Quoted 55 lines
Quoted 55 lines
[ 5071.783605] ttm bnx2x drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm crct10dif_pclmul crc32_pclmul mpt3sas crc32c_intel ahci libahci nvme e1000e ghash_clmulni_intel libata mdio nvme_core raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5071.783658] CPU: 38 PID: 2635321 Comm: fsstress Tainted: G S W 5.11.10-1.el8.x86_64 #1 [ 5071.783664] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5071.783668] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783719] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 60 54 c0 48 89 85 78 ff ff ff e8 98 03 ee cf <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 76 53 [ 5071.783726] RSP: 0018:ffffb090a46cfb00 EFLAGS: 00010286 [ 5071.783730] RAX: 0000000000000000 RBX: ffff8ec518ef60d0 RCX: 0000000000000027 [ 5071.783734] RDX: 0000000000000027 RSI: ffff8ed4afc97d80 RDI: ffff8ed4afc97d88 [ 5071.783737] RBP: ffffb090a46cfbd0 R08: 0000000000000000 R09: c0000000ffff7fff [ 5071.783740] R10: 0000000000000001 R11: ffffb090a46cf908 R12: ffff8ea6284be240 [ 5071.783743] R13: ffff8ec519783400 R14: ffff8ec4fa591800 R15: 00000000fffffff4 [ 5071.783747] FS: 00007fe2123fc000(0000) GS:ffff8ed4afc80000(0000) knlGS:0000000000000000 [ 5071.783751] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5071.783754] CR2: 00007fe2123fa000 CR3: 000000010f866002 CR4: 00000000001706e0 [ 5071.783758] Call Trace: [ 5071.783767] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783817] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783889] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5071.783939] ? btrfs_record_root_in_trans+0x56/0x60 [btrfs] [ 5071.783987] ? finish_wait+0x80/0x80 [ 5071.783994] btrfs_mksubvol+0x2b0/0x440 [btrfs] [ 5071.784058] btrfs_mksnapshot+0x75/0xa0 [btrfs] [ 5071.784120] __btrfs_ioctl_snap_create+0x167/0x170 [btrfs] [ 5071.784181] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5071.784241] btrfs_ioctl+0xb9e/0x2f30 [btrfs] [ 5071.784303] ? __x64_sys_ioctl+0x84/0xc0 [ 5071.784310] __x64_sys_ioctl+0x84/0xc0 [ 5071.784317] do_syscall_64+0x33/0x40 [ 5071.784325] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5071.784334] RIP: 0033:0x7fe2116f388b [ 5071.784339] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5071.784344] RSP: 002b:00007fffa709dfe8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5071.784349] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe2116f388b [ 5071.784352] RDX: 00007fffa709f010 RSI: 0000000050009417 RDI: 0000000000000005 [ 5071.784356] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 [ 5071.784359] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 [ 5071.784362] R13: 00007fffa70a0060 R14: 0000000000000005 R15: 0000000000000005 [ 5071.784367] ---[ end trace 1b8c9453a855d694 ]--- [ 5071.784376] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5071.784382] BTRFS info (device sdb1): forced readonly [ 5071.784388] btrfs_printk: 72 callbacks suppressed [ 5071.784389] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5071.784395] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5083.887607] BTRFS info (device sdb1): using free space tree [ 5083.887619] BTRFS info (device sdb1): has skinny extents [ 5083.897508] BTRFS info (device sdb1): enabling ssd optimizations [ 5083.962955] BTRFS info (device sdb1): checking UUID treexfstest (check) is easy than xfstest (check generic/476) to reproduce this problem.
CONFIG_PGTABLE_LEVELS=4in config-5.11.10-1 , so we test it again inCONFIG_PGTABLE_LEVELS=5, this problem happened too.
Quoted 15 lines
Quoted 7 lines
[ 5517.540314] run fstests generic/476 at 2021-03-26 22:44:25 [ 5517.749126] BTRFS info (device nvme0n1p1): using free space tree [ 5517.750050] BTRFS info (device nvme0n1p1): has skinny extents [ 5517.753372] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 5517.817411] BTRFS: device fsid d45acee6-3d3c-44d9-88be-46edd236b457 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2645359) [ 5517.832014] BTRFS info (device sdb1): using free space tree [ 5517.833034] BTRFS info (device sdb1): has skinny extentsQuoted 8 lines
[ 5517.834032] BTRFS info (device sdb1): flagging fs with big metadata feature [ 5517.836874] BTRFS info (device sdb1): enabling ssd optimizations [ 5517.838057] BTRFS info (device sdb1): cleaning free space cache v1 [ 5517.839759] BTRFS info (device sdb1): checking UUID tree [ 5665.863820] ------------[ cut here ]------------ [ 5665.865301] BTRFS: Transaction aborted (error -12) [ 5665.865372] WARNING: CPU: 34 PID: 2645395 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.866756] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek sb_edac snd_hda_codec_generic snd_hda_codec_hdmi ledtrig_audio x86_pkg_temp_thermal intel_powerclamp snd_hda_intel coretemp snd_intel_dspcfg kvm_intel snd_hda_codec snd_hda_core dcdbas iTCO_wdt mei_wdt iTCO_vendor_support dell_smm_hwmon snd_hwdep kvm snd_seq snd_seq_device snd_pcm irqbypass rapl snd_timer intel_cstate snd intel_uncore mei_me i2c_i801 pcspkr i2c_smbus mei lpc_ich soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt nfsd rdma_rxe ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_tt
m_helper
Quoted 59 lines
Quoted 58 lines
[ 5665.866851] ttm drm_kms_helper bnx2x syscopyarea sysfillrect sysimgblt fb_sys_fops cec ahci crct10dif_pclmul libahci crc32_pclmul nvme crc32c_intel drm mpt3sas libata e1000e ghash_clmulni_intel nvme_core mdio raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5665.882765] CPU: 34 PID: 2645395 Comm: fsstress Tainted: G S 5.11.10-2.el8.x86_64 #1 [ 5665.884634] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5665.886592] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.888599] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 20 3c c0 48 89 85 78 ff ff ff e8 50 86 46 f0 <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 36 3b [ 5665.892739] RSP: 0018:ffffb82ee81ffa60 EFLAGS: 00010286 [ 5665.894863] RAX: 0000000000000000 RBX: ffff9ffcf0aae6e8 RCX: 0000000000000027 [ 5665.897001] RDX: 0000000000000027 RSI: ffffa00b6fb97d80 RDI: ffffa00b6fb97d88 [ 5665.899160] RBP: ffffb82ee81ffb30 R08: 0000000000000000 R09: c0000000ffff7fff [ 5665.901363] R10: 0000000000000001 R11: ffffb82ee81ff868 R12: ffff9ffc825fb800 [ 5665.903556] R13: ffff9ffbdb759800 R14: ffff9fdeb761c000 R15: 00000000fffffff4 [ 5665.905765] FS: 00007f8100d50000(0000) GS:ffffa00b6fb80000(0000) knlGS:0000000000000000 [ 5665.908029] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5665.910285] CR2: 0000000001c83638 CR3: 00000004e3ab0002 CR4: 00000000001706e0 [ 5665.912575] Call Trace: [ 5665.914870] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.917249] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.919583] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5665.921945] ? btrfs_block_rsv_release+0xe2/0x2a0 [btrfs] [ 5665.924319] ? finish_wait+0x80/0x80 [ 5665.926664] create_subvol+0x4ef/0x8c0 [btrfs] [ 5665.929056] btrfs_mksubvol+0x36e/0x440 [btrfs] [ 5665.931441] ? path_openat+0x638/0xfd0 [ 5665.933758] __btrfs_ioctl_snap_create+0x11c/0x170 [btrfs] [ 5665.936077] ? _copy_from_user+0x3a/0x70 [ 5665.938337] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5665.940657] btrfs_ioctl+0x9b0/0x2f30 [btrfs] [ 5665.943001] ? tick_sched_handle.isra.23+0x1f/0x60 [ 5665.945275] ? __x64_sys_ioctl+0x84/0xc0 [ 5665.947526] __x64_sys_ioctl+0x84/0xc0 [ 5665.949756] do_syscall_64+0x33/0x40 [ 5665.951992] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5665.954230] RIP: 0033:0x7f810004188b [ 5665.956396] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5665.961062] RSP: 002b:00007fff3bbbe388 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5665.963468] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f810004188b [ 5665.965863] RDX: 00007fff3bbbe390 RSI: 0000000050009418 RDI: 0000000000000004 [ 5665.968236] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000006 [ 5665.970649] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005 [ 5665.973027] R13: 0000000000404d60 R14: 0000000000000000 R15: 0000000000000000 [ 5665.975416] ---[ end trace 648a28c0cc4e3cd4 ]--- [ 5665.977818] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5665.980170] BTRFS info (device sdb1): forced readonly [ 5665.982528] btrfs_printk: 241 callbacks suppressed [ 5665.982531] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5665.987121] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5678.073600] BTRFS info (device sdb1): using free space tree [ 5678.075716] BTRFS info (device sdb1): has skinny extents [ 5678.086808] BTRFS info (device sdb1): enabling ssd optimizations [ 5678.146553] BTRFS info (device sdb1): checking UUID treeIt is not clear whether it is a btrfs problem or a linux mm problem. but firstly report it as btrfs problem.
Best Regards
Wang Yugui ([email protected])
2021/03/26
Hi,
kmem_cache_zalloc() without __GFP_NOFAIL may fail.
btrfs use kmem_cache_zalloc() with GFP_NOFS mostly, and only few place with __GFP_NOFAIL.
xfs use kmem_cache_zalloc() with __GFP_NOFAIL mostly.
It is very difficult to test all case of failure in kmem_cache_zalloc() .
Should btrfs use kmem_cache_zalloc() with __GFP_NOFAIL just like xfs or use mempool with pre-alloc to prevent fail?
Best Regards
Wang Yugui ([email protected])
2021/03/27
Quoted 52 lines
Hi,
these callstack have a same root failure.
structbtrfs_path*btrfs_alloc_path(void){ return kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS); }
fs/btrfs/transaction.c:1679create_pending_snapshot+0xc1a/0xda0[btrfs](fail)new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev); (fail)btrfs_get_root_ref (fail)btrfs_alloc_path
fs/btrfs/ioctl.c:718create_subvol+0x888/0x8f0[btrfs](fail)new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev); (fail)btrfs_get_root_ref (fail)btrfs_alloc_pathAny advice whether it is a btrfs usage problem , or linux mm implement problem, or expected behavior ?
this server has 192G memory and no swap.
/etc/sysctl.conf
#10G/1G
vm.dirty_bytes=10737418240
vm.dirty_background_bytes=1073741824And the filesystem is 10GiB
# cat /usr/hpc-bio/xfstests/results//generic/476.full btrfs-progs v5.10.1 See http://btrfs.wiki.kernel.org for more information.Detected a SSD, turning off metadata duplication. Mkfs with -m dup if you want to force metadata duplication.
Label: (null) UUID: 776508dd-165d-4150-89a9-0cdd13a0004a Node size: 16384 Sector size: 4096 Filesystem size: 10.00GiB Block group profiles: Data: single 8.00MiB Metadata: single 8.00MiB System: single 4.00MiB SSD detected: yes Incompat features: extref, skinny-metadata, no-holes Runtime features: free-space-tree Checksum: crc32c Number of devices: 1 Devices: ID SIZE PATH 1 10.00GiB /dev/sdb1
Quoted 31 lines
Best Regards
Wang Yugui ([email protected])
2021/03/27Quoted 27 lines
Hi,
SSD/SAS is easy than SSD/NVMe to reproduce this problem.
Yet not able to reproduce this problem on another server.
CPU: Xeon(R) CPU E5-2680 v2(10 core) *2 memory: 192G, no swap disk: SSD/NVMe with same partition size as SSD/SAS.And this problem happened in kernel 5.10.26 + btrfs backport from 5.12.0-rc4 with a different callstack.
[10459.782442] run fstests generic/476 at 2021-03-27 15:02:14 [10459.988507] BTRFS info (device nvme0n1p1): has skinny extents [10459.988515] BTRFS info (device nvme0n1p1): using free space tree [10459.991086] BTRFS info (device nvme0n1p1): enabling ssd optimizations [10460.062565] BTRFS: device fsid 776508dd-165d-4150-89a9-0cdd13a0004a devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2713399) [10460.075938] BTRFS info (device sdb1): has skinny extents [10460.075947] BTRFS info (device sdb1): flagging fs with big metadata feature [10460.075950] BTRFS info (device sdb1): using free space tree [10460.077791] BTRFS info (device sdb1): enabling ssd optimizations [10460.078662] BTRFS info (device sdb1): checking UUID tree [10604.622052] ------------[ cut here ]------------ [10604.622062] BTRFS: Transaction aborted (error -12) [10604.622182] WARNING: CPU: 10 PID: 2713438 at fs/btrfs/ioctl.c:718 create_subvol+0x888/0x8f0 [btrfs] [10604.622187] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_flakey loop rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi intel_rapl_msr intel_rapl_common snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation snd_soc_core sb_edac x86_pkg_temp_thermal snd_compress iTCO_wdt intel_powerclamp intel_pmc_bxt snd_pcm_dmaengine coretemp soundwire_cadence mei_wdt mei_hdcp iTCO_vendor_support kvm_intel snd_hda_codec dcdbas dell_smm_hwmon snd_hda_core kvm ac97_bus snd_hwdep snd_seq snd_seq_device irqbypass snd_pcm rapl intel_cstate mei_me snd_timer i2c_i801 intel_uncore snd mei i2c_smbus lpc_ich soundcore nvme_rdma nvme_fabrics rdma_cm iw_cm ib_cm rdmavt rdma_rxe nfsd ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgs
s nfs_acl
Quoted 65 lines
Quoted 65 lines
[10604.622244] lockd grace nfs_ssc ip_tables xfs radeon i2c_algo_bit bnx2x ttm drm_kms_helper cec crct10dif_pclmul crc32_pclmul crc32c_intel drm nvme mpt3sas e1000e pcspkr mdio ghash_clmulni_intel nvme_core raid_class scsi_transport_sas wmi dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua btrfs xor raid6_pq sunrpc i2c_dev [last unloaded: scsi_debug] [10604.622292] CPU: 10 PID: 2713438 Comm: fsstress Tainted: G S 5.10.26-3.el7.x86_64 #1 [10604.622296] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [10604.622333] RIP: 0010:create_subvol+0x888/0x8f0 [btrfs] [10604.622337] Code: 8b 40 50 f0 48 0f ba a8 50 0a 00 00 03 72 1d 41 83 ff fb 74 37 41 83 ff e2 74 31 44 89 fe 48 c7 c7 f0 44 59 c0 e8 ec 6b 5a f6 <0f> 0b 48 8b bd 30 ff ff ff 44 89 f9 ba ce 02 00 00 48 c7 c6 80 2a [10604.622342] RSP: 0018:ffffafd7326cfc08 EFLAGS: 00010286 [10604.622346] RAX: 0000000000000000 RBX: ffff9071a992ca00 RCX: 0000000000000027 [10604.622348] RDX: 0000000000000027 RSI: ffff90812f818a80 RDI: ffff90812f818a88 [10604.622351] RBP: ffffafd7326cfce8 R08: 0000000000000000 R09: c0000000ffffd1cc [10604.622354] R10: fffffffffffd00d0 R11: ffffafd7326cfa10 R12: 00000000fffffff4 [10604.622358] R13: ffff905445386000 R14: ffff9071e9b40230 R15: fffffffffffffff4 [10604.622361] FS: 00007fb9e7398000(0000) GS:ffff90812f800000(0000) knlGS:0000000000000000 [10604.622364] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [10604.622367] CR2: 00000000009c5c40 CR3: 000000020d826002 CR4: 00000000001706e0 [10604.622370] Call Trace: [10604.622411] btrfs_mksubvol+0x368/0x440 [btrfs] [10604.622447] __btrfs_ioctl_snap_create+0x11c/0x170 [btrfs] [10604.622455] ? _copy_from_user+0x3a/0x70 [10604.622488] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [10604.622522] btrfs_ioctl+0x9d5/0x2f80 [btrfs] [10604.622528] ? __handle_mm_fault+0x797/0x7c0 [10604.622534] ? __x64_sys_ioctl+0x84/0xc0 [10604.622536] __x64_sys_ioctl+0x84/0xc0 [10604.622542] do_syscall_64+0x33/0x40 [10604.622549] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [10604.622552] RIP: 0033:0x7fb9e668988b [10604.622556] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [10604.622561] RSP: 002b:00007fff461628b8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [10604.622565] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb9e668988b [10604.622569] RDX: 00007fff461628c0 RSI: 0000000050009418 RDI: 0000000000000004 [10604.622572] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000006 [10604.622575] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005 [10604.622577] R13: 0000000000404d60 R14: 0000000000000000 R15: 0000000000000000 [10604.622582] ---[ end trace ca8166c2db3ed522 ]--- [10604.622587] BTRFS: error (device sdb1) in create_subvol:718: errno=-12 Out of memory [10604.622591] BTRFS info (device sdb1): forced readonly [10617.634193] BTRFS info (device sdb1): has skinny extents [10617.634205] BTRFS info (device sdb1): using free space tree [10617.642932] BTRFS info (device sdb1): enabling ssd optimizations
fs/btrfs/ioctl.c:718new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev); if (IS_ERR(new_root)) { free_anon_bdev(anon_dev); ret = PTR_ERR(new_root); btrfs_abort_transaction(trans, ret); goto fail; }Best Regards
Wang Yugui ([email protected])
2021/03/27Quoted 9 lines
Hi,
xfstests generic/476 failed on
btrfs(errno=-12 Out of memory, kernel 5.11.10)The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swap kernel config: see the file config-5.11.10-1
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
# cat /ssd/git/os/xfstests/results//generic/476.dmesg [ 4890.430304] run fstests generic/476 at 2021-03-26 19:02:17 [ 4890.634292] BTRFS info (device nvme0n1p1): using free space tree [ 4890.634303] BTRFS info (device nvme0n1p1): has skinny extents [ 4890.636509] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 4890.697326] BTRFS: device fsid e9634b28-1ede-4e14-bb0b-18226e5858d0 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2635285) [ 4890.711959] BTRFS info (device sdb1): using free space tree [ 4890.711967] BTRFS info (device sdb1): has skinny extentsQuoted 8 lines
Quoted 8 lines
[ 4890.711971] BTRFS info (device sdb1): flagging fs with big metadata feature [ 4890.713813] BTRFS info (device sdb1): enabling ssd optimizations [ 4890.713993] BTRFS info (device sdb1): cleaning free space cache v1 [ 4890.714664] BTRFS info (device sdb1): checking UUID tree [ 5071.783374] ------------[ cut here ]------------ [ 5071.783387] BTRFS: Transaction aborted (error -12) [ 5071.783452] WARNING: CPU: 38 PID: 2635321 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783529] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek snd_hda_codec_generic sb_edac x86_pkg_temp_thermal snd_hda_codec_hdmi ledtrig_audio intel_powerclamp coretemp dcdbas kvm_intel snd_hda_intel mei_wdt snd_intel_dspcfg iTCO_wdt iTCO_vendor_support dell_smm_hwmon snd_hda_codec kvm snd_hda_core snd_hwdep snd_seq snd_seq_device irqbypass snd_pcm rapl intel_cstate snd_timer mei_me snd intel_uncore i2c_i801 pcspkr mei lpc_ich i2c_smbus soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt rdma_rxe nfsd ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_
ttm_helper
Quoted 55 lines
Quoted 55 lines
Quoted 55 lines
[ 5071.783605] ttm bnx2x drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm crct10dif_pclmul crc32_pclmul mpt3sas crc32c_intel ahci libahci nvme e1000e ghash_clmulni_intel libata mdio nvme_core raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5071.783658] CPU: 38 PID: 2635321 Comm: fsstress Tainted: G S W 5.11.10-1.el8.x86_64 #1 [ 5071.783664] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5071.783668] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5071.783719] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 60 54 c0 48 89 85 78 ff ff ff e8 98 03 ee cf <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 76 53 [ 5071.783726] RSP: 0018:ffffb090a46cfb00 EFLAGS: 00010286 [ 5071.783730] RAX: 0000000000000000 RBX: ffff8ec518ef60d0 RCX: 0000000000000027 [ 5071.783734] RDX: 0000000000000027 RSI: ffff8ed4afc97d80 RDI: ffff8ed4afc97d88 [ 5071.783737] RBP: ffffb090a46cfbd0 R08: 0000000000000000 R09: c0000000ffff7fff [ 5071.783740] R10: 0000000000000001 R11: ffffb090a46cf908 R12: ffff8ea6284be240 [ 5071.783743] R13: ffff8ec519783400 R14: ffff8ec4fa591800 R15: 00000000fffffff4 [ 5071.783747] FS: 00007fe2123fc000(0000) GS:ffff8ed4afc80000(0000) knlGS:0000000000000000 [ 5071.783751] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5071.783754] CR2: 00007fe2123fa000 CR3: 000000010f866002 CR4: 00000000001706e0 [ 5071.783758] Call Trace: [ 5071.783767] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783817] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5071.783889] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5071.783939] ? btrfs_record_root_in_trans+0x56/0x60 [btrfs] [ 5071.783987] ? finish_wait+0x80/0x80 [ 5071.783994] btrfs_mksubvol+0x2b0/0x440 [btrfs] [ 5071.784058] btrfs_mksnapshot+0x75/0xa0 [btrfs] [ 5071.784120] __btrfs_ioctl_snap_create+0x167/0x170 [btrfs] [ 5071.784181] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5071.784241] btrfs_ioctl+0xb9e/0x2f30 [btrfs] [ 5071.784303] ? __x64_sys_ioctl+0x84/0xc0 [ 5071.784310] __x64_sys_ioctl+0x84/0xc0 [ 5071.784317] do_syscall_64+0x33/0x40 [ 5071.784325] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5071.784334] RIP: 0033:0x7fe2116f388b [ 5071.784339] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5071.784344] RSP: 002b:00007fffa709dfe8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5071.784349] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe2116f388b [ 5071.784352] RDX: 00007fffa709f010 RSI: 0000000050009417 RDI: 0000000000000005 [ 5071.784356] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 [ 5071.784359] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 [ 5071.784362] R13: 00007fffa70a0060 R14: 0000000000000005 R15: 0000000000000005 [ 5071.784367] ---[ end trace 1b8c9453a855d694 ]--- [ 5071.784376] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5071.784382] BTRFS info (device sdb1): forced readonly [ 5071.784388] btrfs_printk: 72 callbacks suppressed [ 5071.784389] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5071.784395] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5083.887607] BTRFS info (device sdb1): using free space tree [ 5083.887619] BTRFS info (device sdb1): has skinny extents [ 5083.897508] BTRFS info (device sdb1): enabling ssd optimizations [ 5083.962955] BTRFS info (device sdb1): checking UUID treexfstest (check) is easy than xfstest (check generic/476) to reproduce this problem.
CONFIG_PGTABLE_LEVELS=4in config-5.11.10-1 , so we test it again inCONFIG_PGTABLE_LEVELS=5, this problem happened too.
Quoted 15 lines
Quoted 7 lines
Quoted 7 lines
[ 5517.540314] run fstests generic/476 at 2021-03-26 22:44:25 [ 5517.749126] BTRFS info (device nvme0n1p1): using free space tree [ 5517.750050] BTRFS info (device nvme0n1p1): has skinny extents [ 5517.753372] BTRFS info (device nvme0n1p1): enabling ssd optimizations [ 5517.817411] BTRFS: device fsid d45acee6-3d3c-44d9-88be-46edd236b457 devid 1 transid 6 /dev/sdb1 scanned by mkfs.btrfs (2645359) [ 5517.832014] BTRFS info (device sdb1): using free space tree [ 5517.833034] BTRFS info (device sdb1): has skinny extentsQuoted 8 lines
Quoted 8 lines
[ 5517.834032] BTRFS info (device sdb1): flagging fs with big metadata feature [ 5517.836874] BTRFS info (device sdb1): enabling ssd optimizations [ 5517.838057] BTRFS info (device sdb1): cleaning free space cache v1 [ 5517.839759] BTRFS info (device sdb1): checking UUID tree [ 5665.863820] ------------[ cut here ]------------ [ 5665.865301] BTRFS: Transaction aborted (error -12) [ 5665.865372] WARNING: CPU: 34 PID: 2645395 at fs/btrfs/transaction.c:1679 create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.866756] Modules linked in: dm_thin_pool dm_persistent_data dm_bio_prison dm_snapshot dm_bufio dm_flakey loop ext4 mbcache jbd2 rpcsec_gss_krb5 nfsv4 dns_resolver nfs nfs_ssc fscache rfkill rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib rdma_ucm ib_umad intel_rapl_msr intel_rapl_common snd_hda_codec_realtek sb_edac snd_hda_codec_generic snd_hda_codec_hdmi ledtrig_audio x86_pkg_temp_thermal intel_powerclamp snd_hda_intel coretemp snd_intel_dspcfg kvm_intel snd_hda_codec snd_hda_core dcdbas iTCO_wdt mei_wdt iTCO_vendor_support dell_smm_hwmon snd_hwdep kvm snd_seq snd_seq_device snd_pcm irqbypass rapl snd_timer intel_cstate snd intel_uncore mei_me i2c_i801 pcspkr i2c_smbus mei lpc_ich soundcore nvme_rdma rdma_cm iw_cm ib_cm nvme_fabrics rdmavt nfsd rdma_rxe ib_uverbs ip6_udp_tunnel udp_tunnel ib_core auth_rpcgss nfs_acl lockd grace ip_tables xfs sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_
ttm_helper
Quoted 60 lines
Quoted 59 lines
Quoted 58 lines
[ 5665.866851] ttm drm_kms_helper bnx2x syscopyarea sysfillrect sysimgblt fb_sys_fops cec ahci crct10dif_pclmul libahci crc32_pclmul nvme crc32c_intel drm mpt3sas libata e1000e ghash_clmulni_intel nvme_core mdio raid_class scsi_transport_sas t10_pi wmi dm_multipath btrfs xor zstd_decompress zstd_compress raid6_pq sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev [last unloaded: scsi_debug] [ 5665.882765] CPU: 34 PID: 2645395 Comm: fsstress Tainted: G S 5.11.10-2.el8.x86_64 #1 [ 5665.884634] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019 [ 5665.886592] RIP: 0010:create_pending_snapshot+0xc1a/0xda0 [btrfs] [ 5665.888599] Code: 03 72 30 83 f8 fb 0f 84 45 01 00 00 83 f8 e2 0f 84 3c 01 00 00 89 c6 48 c7 c7 f0 20 3c c0 48 89 85 78 ff ff ff e8 50 86 46 f0 <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 8f 06 00 00 48 c7 c6 50 36 3b [ 5665.892739] RSP: 0018:ffffb82ee81ffa60 EFLAGS: 00010286 [ 5665.894863] RAX: 0000000000000000 RBX: ffff9ffcf0aae6e8 RCX: 0000000000000027 [ 5665.897001] RDX: 0000000000000027 RSI: ffffa00b6fb97d80 RDI: ffffa00b6fb97d88 [ 5665.899160] RBP: ffffb82ee81ffb30 R08: 0000000000000000 R09: c0000000ffff7fff [ 5665.901363] R10: 0000000000000001 R11: ffffb82ee81ff868 R12: ffff9ffc825fb800 [ 5665.903556] R13: ffff9ffbdb759800 R14: ffff9fdeb761c000 R15: 00000000fffffff4 [ 5665.905765] FS: 00007f8100d50000(0000) GS:ffffa00b6fb80000(0000) knlGS:0000000000000000 [ 5665.908029] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5665.910285] CR2: 0000000001c83638 CR3: 00000004e3ab0002 CR4: 00000000001706e0 [ 5665.912575] Call Trace: [ 5665.914870] ? create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.917249] create_pending_snapshots+0xa2/0xc0 [btrfs] [ 5665.919583] btrfs_commit_transaction+0x297/0xb10 [btrfs] [ 5665.921945] ? btrfs_block_rsv_release+0xe2/0x2a0 [btrfs] [ 5665.924319] ? finish_wait+0x80/0x80 [ 5665.926664] create_subvol+0x4ef/0x8c0 [btrfs] [ 5665.929056] btrfs_mksubvol+0x36e/0x440 [btrfs] [ 5665.931441] ? path_openat+0x638/0xfd0 [ 5665.933758] __btrfs_ioctl_snap_create+0x11c/0x170 [btrfs] [ 5665.936077] ? _copy_from_user+0x3a/0x70 [ 5665.938337] btrfs_ioctl_snap_create_v2+0x111/0x140 [btrfs] [ 5665.940657] btrfs_ioctl+0x9b0/0x2f30 [btrfs] [ 5665.943001] ? tick_sched_handle.isra.23+0x1f/0x60 [ 5665.945275] ? __x64_sys_ioctl+0x84/0xc0 [ 5665.947526] __x64_sys_ioctl+0x84/0xc0 [ 5665.949756] do_syscall_64+0x33/0x40 [ 5665.951992] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 5665.954230] RIP: 0033:0x7f810004188b [ 5665.956396] Code: 0f 1e fa 48 8b 05 fd 95 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 0f 1f 44 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cd 95 2c 00 f7 d8 64 89 01 48 [ 5665.961062] RSP: 002b:00007fff3bbbe388 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 5665.963468] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f810004188b [ 5665.965863] RDX: 00007fff3bbbe390 RSI: 0000000050009418 RDI: 0000000000000004 [ 5665.968236] RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000006 [ 5665.970649] R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000005 [ 5665.973027] R13: 0000000000404d60 R14: 0000000000000000 R15: 0000000000000000 [ 5665.975416] ---[ end trace 648a28c0cc4e3cd4 ]--- [ 5665.977818] BTRFS: error (device sdb1) in create_pending_snapshot:1679: errno=-12 Out of memory [ 5665.980170] BTRFS info (device sdb1): forced readonly [ 5665.982528] btrfs_printk: 241 callbacks suppressed [ 5665.982531] BTRFS warning (device sdb1): Skipping commit of aborted transaction. [ 5665.987121] BTRFS: error (device sdb1) in cleanup_transaction:1939: errno=-12 Out of memory [ 5678.073600] BTRFS info (device sdb1): using free space tree [ 5678.075716] BTRFS info (device sdb1): has skinny extents [ 5678.086808] BTRFS info (device sdb1): enabling ssd optimizations [ 5678.146553] BTRFS info (device sdb1): checking UUID treeIt is not clear whether it is a btrfs problem or a linux mm problem. but firstly report it as btrfs problem.
Best Regards
Wang Yugui ([email protected])
2021/03/26
Hi,
Quoted 11 lines
kmem_cache_zalloc()without__GFP_NOFAILmay fail.btrfs use
kmem_cache_zalloc()withGFP_NOFSmostly, and only few place with__GFP_NOFAIL.xfs use
kmem_cache_zalloc()with__GFP_NOFAILmostly.It is very difficult to test all case of failure in
kmem_cache_zalloc().Should btrfs use
kmem_cache_zalloc()with__GFP_NOFAILjust like xfs or use mempool with pre-alloc to prevent fail?
I tried both way.
1) add __GFP_NOFAIL to kmem_cache_zalloc() see 0001-btrfs-add-__GFP_NOFAIL-to-kmem_cache.patch
but this problem still happened in test.
2) switch to use mempool_t for btrfs_path
see 0001-btrfs-switch-to-mempool_t-for-btrfs_path.patch
this problem yet not happen in test.
But the memory alloc failure is difficult to test, we need more review.
Best Regards
Wang Yugui ([email protected])
2021/03/28
From 2d03c3a6f1cf3db05212f9c3745e2ea81baf8b85 Mon Sep 17 00:00:00 2001
From: wangyugui <[email protected]>
Date: Sat, 27 Mar 2021 23:00:23 +0800
Subject: [PATCH] btrfs: add __GFP_NOFAIL to kmem_cache
--- fs/btrfs/backref.c | 19 +++++++++---------- fs/btrfs/ctree.c | 2 +- fs/btrfs/delayed-inode.c | 2 +- fs/btrfs/delayed-ref.c | 10 +++++----- fs/btrfs/delayed-ref.h | 2 +- fs/btrfs/disk-io.c | 2 +- fs/btrfs/extent_io.c | 12 ++++++------ fs/btrfs/extent_map.c | 2 +- fs/btrfs/file.c | 2 +- fs/btrfs/free-space-cache.c | 18 +++++++----------- fs/btrfs/ordered-data.c | 2 +- fs/btrfs/transaction.c | 2 +- 12 files changed, 35 insertions(+), 40 deletions(-)
fs/btrfs/backref.c +9 -10
@@ -736,8 +736,7 @@ static int resolve_indirect_refs(struct btrfs_fs_info *fs_info,while ((node =ulist_next (parents, &uiter))) {struct prelim_ref *new_ref; - new_ref =kmem_cache_alloc (btrfs_prelim_ref_cache, -GFP_NOFS ); + new_ref =kmem_cache_alloc (btrfs_prelim_ref_cache,GFP_NOFS | __GFP_NOFAIL);if (!new_ref) {free_pref (ref); ret = -ENOMEM ;
@@ -990,7 +989,7 @@ static int add_inline_refs(const struct btrfs_fs_info *fs_info,case BTRFS_SHARED_BLOCK_REF_KEY : ret =add_direct_ref (fs_info, preftrees, *info_level +1 , offset, - bytenr,1 ,NULL ,GFP_NOFS ); + bytenr,1 ,NULL ,GFP_NOFS | __GFP_NOFAIL);break ;case BTRFS_SHARED_DATA_REF_KEY : {struct btrfs_shared_data_ref *sdref;
@@ -1000,13 +999,13 @@ static int add_inline_refs(const struct btrfs_fs_info *fs_info, count =btrfs_shared_data_ref_count (leaf, sdref); ret =add_direct_ref (fs_info, preftrees,0 , offset, - bytenr, count, sc,GFP_NOFS ); + bytenr, count, sc,GFP_NOFS | __GFP_NOFAIL);break ; }case BTRFS_TREE_BLOCK_REF_KEY : ret =add_indirect_ref (fs_info, preftrees, offset,NULL , *info_level +1 , - bytenr,1 ,NULL ,GFP_NOFS ); + bytenr,1 ,NULL ,GFP_NOFS | __GFP_NOFAIL);break ;case BTRFS_EXTENT_DATA_REF_KEY : {struct btrfs_extent_data_ref *dref;
@@ -1029,7 +1028,7 @@ static int add_inline_refs(const struct btrfs_fs_info *fs_info, ret =add_indirect_ref (fs_info, preftrees, root, &key,0 , bytenr, count, - sc,GFP_NOFS ); + sc,GFP_NOFS | __GFP_NOFAIL);break ; }default :
@@ -1084,7 +1083,7 @@ static int add_keyed_refs(struct btrfs_fs_info *fs_info,/* SHARED DIRECT METADATA backref */ ret =add_direct_ref (fs_info, preftrees, info_level +1 , key.offset, - bytenr,1 ,NULL ,GFP_NOFS ); + bytenr,1 ,NULL ,GFP_NOFS | __GFP_NOFAIL);break ;case BTRFS_SHARED_DATA_REF_KEY : {/* SHARED DIRECT FULL backref */
@@ -1096,14 +1095,14 @@ static int add_keyed_refs(struct btrfs_fs_info *fs_info, count =btrfs_shared_data_ref_count (leaf, sdref); ret =add_direct_ref (fs_info, preftrees,0 , key.offset, bytenr, count, - sc,GFP_NOFS ); + sc,GFP_NOFS | __GFP_NOFAIL);break ; }case BTRFS_TREE_BLOCK_REF_KEY :/* NORMAL INDIRECT METADATA backref */ ret =add_indirect_ref (fs_info, preftrees, key.offset,NULL , info_level +1 , bytenr, -1 ,NULL ,GFP_NOFS ); +1 ,NULL ,GFP_NOFS | __GFP_NOFAIL);break ;case BTRFS_EXTENT_DATA_REF_KEY : {/* NORMAL INDIRECT DATA backref */
@@ -1127,7 +1126,7 @@ static int add_keyed_refs(struct btrfs_fs_info *fs_info, root =btrfs_extent_data_ref_root (leaf, dref); ret =add_indirect_ref (fs_info, preftrees, root, &key,0 , bytenr, count, - sc,GFP_NOFS ); + sc,GFP_NOFS | __GFP_NOFAIL);break ; }default :
fs/btrfs/ctree.c +1 -1
@@ -75,7 +75,7 @@ size_t __attribute_const__ btrfs_get_num_csums(void)struct btrfs_path *btrfs_alloc_path (void ) { -return kmem_cache_zalloc (btrfs_path_cachep,GFP_NOFS ); +return kmem_cache_zalloc (btrfs_path_cachep,GFP_NOFS | __GFP_NOFAIL); }/* this also releases the path */
fs/btrfs/delayed-inode.c +1 -1
@@ -133,7 +133,7 @@ again:if (node)return node; - node =kmem_cache_zalloc (delayed_node_cache,GFP_NOFS ); + node =kmem_cache_zalloc (delayed_node_cache,GFP_NOFS | __GFP_NOFAIL);if (!node)return ERR_PTR (-ENOMEM );btrfs_init_delayed_node (node, root, ino);
fs/btrfs/delayed-ref.c +5 -5
@@ -951,11 +951,11 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,ASSERT (generic_ref->type ==BTRFS_REF_METADATA && generic_ref->action);BUG_ON (extent_op && extent_op->is_data); - ref =kmem_cache_alloc (btrfs_delayed_tree_ref_cachep,GFP_NOFS ); + ref =kmem_cache_alloc (btrfs_delayed_tree_ref_cachep,GFP_NOFS | __GFP_NOFAIL);if (!ref)return -ENOMEM ; - head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS ); + head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS | __GFP_NOFAIL);if (!head_ref) {kmem_cache_free (btrfs_delayed_tree_ref_cachep, ref);return -ENOMEM ;
@@ -1044,7 +1044,7 @@ int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans,u8 ref_type;ASSERT (generic_ref->type ==BTRFS_REF_DATA && action); - ref =kmem_cache_alloc (btrfs_delayed_data_ref_cachep,GFP_NOFS ); + ref =kmem_cache_alloc (btrfs_delayed_data_ref_cachep,GFP_NOFS | __GFP_NOFAIL);if (!ref)return -ENOMEM ;
@@ -1060,7 +1060,7 @@ int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans, ref->offset = offset; - head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS ); + head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS | __GFP_NOFAIL);if (!head_ref) {kmem_cache_free (btrfs_delayed_data_ref_cachep, ref);return -ENOMEM ;
@@ -1121,7 +1121,7 @@ int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans,struct btrfs_delayed_ref_head *head_ref;struct btrfs_delayed_ref_root *delayed_refs; - head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS ); + head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS | __GFP_NOFAIL);if (!head_ref)return -ENOMEM ;
fs/btrfs/delayed-ref.h +1 -1
@@ -296,7 +296,7 @@ static inline void btrfs_init_data_ref(struct btrfs_ref *generic_ref,static inline struct btrfs_delayed_extent_op *btrfs_alloc_delayed_extent_op (void ) { -return kmem_cache_alloc (btrfs_delayed_extent_op_cachep,GFP_NOFS ); +return kmem_cache_alloc (btrfs_delayed_extent_op_cachep,GFP_NOFS | __GFP_NOFAIL); } static inline void
fs/btrfs/disk-io.c +1 -1
@@ -736,7 +736,7 @@ blk_status_t btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio, {struct btrfs_end_io_wq *end_io_wq; - end_io_wq =kmem_cache_alloc (btrfs_end_io_wq_cache,GFP_NOFS ); + end_io_wq =kmem_cache_alloc (btrfs_end_io_wq_cache,GFP_NOFS | __GFP_NOFAIL);if (!end_io_wq)return BLK_STS_RESOURCE ;
fs/btrfs/extent_io.c +6 -6
@@ -1227,7 +1227,7 @@ again:* extent state allocations are needed. We'll only know this * after locking the tree. */ - prealloc =alloc_extent_state (GFP_NOFS ); + prealloc =alloc_extent_state (GFP_NOFS | __GFP_NOFAIL);if (!prealloc && !first_iteration)return -ENOMEM ; }
@@ -1412,7 +1412,7 @@ int set_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,*/ BUG_ON (bits &EXTENT_LOCKED ); -return set_extent_bit (tree, start, end, bits,0 ,NULL ,NULL ,GFP_NOFS , +return set_extent_bit (tree, start, end, bits,0 ,NULL ,NULL ,GFP_NOFS | __GFP_NOFAIL, changeset); }
@@ -1428,7 +1428,7 @@ int clear_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, struct extent_state **cached) {return __clear_extent_bit (tree, start, end, bits, wake, delete, - cached,GFP_NOFS ,NULL ); + cached,GFP_NOFS | __GFP_NOFAIL,NULL ); } int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,
@@ -1440,7 +1440,7 @@ int clear_record_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,*/ BUG_ON (bits &EXTENT_LOCKED ); -return __clear_extent_bit (tree, start, end, bits,0 ,0 ,NULL ,GFP_NOFS , +return __clear_extent_bit (tree, start, end, bits,0 ,0 ,NULL ,GFP_NOFS | __GFP_NOFAIL, changeset); }
@@ -1457,7 +1457,7 @@ int lock_extent_bits(struct extent_io_tree *tree, u64 start, u64 end,while (1 ) { err =set_extent_bit (tree, start, end,EXTENT_LOCKED ,EXTENT_LOCKED , &failed_start, - cached_state,GFP_NOFS ,NULL ); + cached_state,GFP_NOFS | __GFP_NOFAIL,NULL );if (err == -EEXIST ) {wait_extent_bit (tree, failed_start, end,EXTENT_LOCKED ); start = failed_start;
@@ -1474,7 +1474,7 @@ int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end)u64 failed_start; err =set_extent_bit (tree, start, end,EXTENT_LOCKED ,EXTENT_LOCKED , - &failed_start,NULL ,GFP_NOFS ,NULL ); + &failed_start,NULL ,GFP_NOFS | __GFP_NOFAIL,NULL );if (err == -EEXIST ) {if (failed_start > start) clear_extent_bit(tree, start, failed_start - 1,
fs/btrfs/extent_map.c +1 -1
@@ -50,7 +50,7 @@ void extent_map_tree_init(struct extent_map_tree *tree)struct extent_map *alloc_extent_map (void ) {struct extent_map *em; - em =kmem_cache_zalloc (extent_map_cache,GFP_NOFS ); + em =kmem_cache_zalloc (extent_map_cache,GFP_NOFS | __GFP_NOFAIL);if (!em)return NULL ;RB_CLEAR_NODE (&em->rb_node);
fs/btrfs/file.c +1 -1
@@ -151,7 +151,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans,else transid = inode->root->last_trans; - defrag =kmem_cache_zalloc (btrfs_inode_defrag_cachep,GFP_NOFS ); + defrag =kmem_cache_zalloc (btrfs_inode_defrag_cachep,GFP_NOFS | __GFP_NOFAIL);if (!defrag)return -ENOMEM ;
fs/btrfs/free-space-cache.c +7 -11
@@ -782,8 +782,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, goto free_cache;while (num_entries) { - e =kmem_cache_zalloc (btrfs_free_space_cachep, -GFP_NOFS ); + e =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS | __GFP_NOFAIL);if (!e) { ret = -ENOMEM ; goto free_cache;
@@ -814,8 +813,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, }else {ASSERT (num_bitmaps); num_bitmaps--; - e->bitmap =kmem_cache_zalloc ( - btrfs_free_space_bitmap_cachep,GFP_NOFS ); + e->bitmap =kmem_cache_zalloc ( btrfs_free_space_bitmap_cachep,GFP_NOFS | __GFP_NOFAIL);if (!e->bitmap) { ret = -ENOMEM ; kmem_cache_free(
@@ -2238,8 +2236,7 @@ new_bitmap:/* no pre-allocated info, allocate a new one */ if (!info) { - info =kmem_cache_zalloc (btrfs_free_space_cachep, -GFP_NOFS ); + info =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS | __GFP_NOFAIL);if (!info) {spin_lock (&ctl->tree_lock); ret = -ENOMEM ;
@@ -2248,8 +2245,7 @@ new_bitmap: }/* allocate the bitmap */ - info->bitmap =kmem_cache_zalloc (btrfs_free_space_bitmap_cachep, -GFP_NOFS ); + info->bitmap =kmem_cache_zalloc (btrfs_free_space_bitmap_cachep,GFP_NOFS | __GFP_NOFAIL); info->trim_state =BTRFS_TRIM_STATE_TRIMMED ;spin_lock (&ctl->tree_lock);if (!info->bitmap) {
@@ -2479,7 +2475,7 @@ int __btrfs_add_free_space(struct btrfs_fs_info *fs_info,ASSERT (!btrfs_is_zoned (fs_info)); - info =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS ); + info =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS | __GFP_NOFAIL);if (!info)return -ENOMEM ;
@@ -4011,7 +4007,7 @@ int test_add_free_space_entry(struct btrfs_block_group *cache, again:if (!info) { - info =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS ); + info =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS | __GFP_NOFAIL);if (!info)return -ENOMEM ; }
@@ -4029,7 +4025,7 @@ again: }if (!map) { - map =kmem_cache_zalloc (btrfs_free_space_bitmap_cachep,GFP_NOFS ); + map =kmem_cache_zalloc (btrfs_free_space_bitmap_cachep,GFP_NOFS | __GFP_NOFAIL);if (!map) {kmem_cache_free (btrfs_free_space_cachep, info);return -ENOMEM ;
fs/btrfs/ordered-data.c +1 -1
@@ -186,7 +186,7 @@ static int __btrfs_add_ordered_extent(struct btrfs_inode *inode, u64 file_offsetif (ret <0 )return ret; } - entry =kmem_cache_zalloc (btrfs_ordered_extent_cache,GFP_NOFS ); + entry =kmem_cache_zalloc (btrfs_ordered_extent_cache,GFP_NOFS | __GFP_NOFAIL);if (!entry)return -ENOMEM ;
fs/btrfs/transaction.c +1 -1
@@ -653,7 +653,7 @@ start_transaction(struct btrfs_root *root, unsigned int num_items, goto reserve_fail; } again: - h =kmem_cache_zalloc (btrfs_trans_handle_cachep,GFP_NOFS ); + h =kmem_cache_zalloc (btrfs_trans_handle_cachep,GFP_NOFS | __GFP_NOFAIL);if (!h) { ret = -ENOMEM ; goto alloc_fail;
Signature · 1 line
2.30.2
From 838fbef7fdd0f25110c675052a2f17926a5ecd71 Mon Sep 17 00:00:00 2001
From: wangyugui <[email protected]>
Date: Sun, 28 Mar 2021 18:14:41 +0800
Subject: [PATCH] btrfs: switch to mempool_t for btrfs_path
--- fs/btrfs/ctree.c | 7 +++++-- fs/btrfs/ctree.h | 2 +- fs/btrfs/inode.c | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-)
fs/btrfs/ctree.c +5 -2
@@ -75,7 +75,10 @@ size_t __attribute_const__ btrfs_get_num_csums(void)struct btrfs_path *btrfs_alloc_path (void ) { -return kmem_cache_zalloc (btrfs_path_cachep,GFP_NOFS ); +struct btrfs_path *p =mempool_alloc (btrfs_path_pool,GFP_NOFS ); +if (p) +memset (p,0 ,sizeof (*p)); +return p; }/* this also releases the path */
@@ -84,7 +87,7 @@ void btrfs_free_path(struct btrfs_path *p)if (!p)return ;btrfs_release_path (p); -kmem_cache_free (btrfs_path_cachep, p); +mempool_free (p, btrfs_path_pool); }/*
fs/btrfs/ctree.h +1 -1
@@ -43,7 +43,7 @@ struct btrfs_space_info;struct btrfs_block_group ;extern struct kmem_cache *btrfs_trans_handle_cachep;extern struct kmem_cache *btrfs_bit_radix_cachep; -extern struct kmem_cache *btrfs_path_cachep; +extern mempool_t *btrfs_path_pool;extern struct kmem_cache *btrfs_free_space_cachep;extern struct kmem_cache *btrfs_free_space_bitmap_cachep;struct btrfs_ordered_sum ;
fs/btrfs/inode.c +6 -1
@@ -73,7 +73,8 @@ static const struct file_operations btrfs_dir_file_operations;static struct kmem_cache *btrfs_inode_cachep;struct kmem_cache *btrfs_trans_handle_cachep; -struct kmem_cache *btrfs_path_cachep; +static struct kmem_cache *btrfs_path_cachep; +mempool_t *btrfs_path_pool;struct kmem_cache *btrfs_free_space_cachep;struct kmem_cache *btrfs_free_space_bitmap_cachep;
@@ -8979,6 +8980,7 @@ void __cold btrfs_destroy_cachep(void)rcu_barrier ();kmem_cache_destroy (btrfs_inode_cachep);kmem_cache_destroy (btrfs_trans_handle_cachep); +mempool_destroy (btrfs_path_pool);kmem_cache_destroy (btrfs_path_cachep);kmem_cache_destroy (btrfs_free_space_cachep);kmem_cache_destroy (btrfs_free_space_bitmap_cachep);
@@ -9004,6 +9006,9 @@ int __init btrfs_init_cachep(void) SLAB_MEM_SPREAD, NULL);if (!btrfs_path_cachep) goto fail; + btrfs_path_pool =mempool_create_slab_pool (2048 , btrfs_path_cachep); +if (!btrfs_path_pool) + goto fail; btrfs_free_space_cachep = kmem_cache_create("btrfs_free_space", sizeof(struct btrfs_free_space), 0,
Signature · 1 line
2.30.2
Hi, Nikolay Borisov
With a lot of dump_stack()/printk inserted around ENOMEM in btrfs code, we find out the call stack for ENOMEM.
see the file 0000-btrfs-dump_stack-when-ENOMEM.patch
#cat /usr/hpc-bio/xfstests/results//generic/476.dmesg
...
[ 5759.102929] ENOMEM btrfs_drew_lock_init [ 5759.102943] ENOMEM btrfs_init_fs_root [ 5759.102947] ------------[ cut here ]------------ [ 5759.102950] BTRFS: Transaction aborted (error -12) [ 5759.103052] WARNING: CPU: 14 PID: 2741468 at /ssd/hpc-bio/linux-5.10.27/fs/btrfs/transaction.c:1705 create_pending_snapshot+0xb8c/0xd50 [btrfs]
...
btrfs_drew_lock_init() return -ENOMEM,
this is the source:
/*
* We might be called under a transaction (e.g. indirect backref
* resolution) which could deadlock if it triggers memory reclaim
*/
nofs_flag = memalloc_nofs_save();
ret = btrfs_drew_lock_init(&root->snapshot_lock);
memalloc_nofs_restore(nofs_flag);
if (ret == -ENOMEM) printk("ENOMEM btrfs_drew_lock_init\n");
if (ret)
goto fail;And the souce come from:
commit dcc3eb9638c3c927f1597075e851d0a16300a876
Author: Nikolay Borisov <[email protected]> Date: Thu Jan 30 14:59:45 2020 +0200
btrfs: convert snapshot/nocow exlcusion to drew lock
Any advice to fix this ENOMEM problem?
top command show that this server have engough memory.
The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swap
Quoted 20 lines
Quoted 11 lines
kmem_cache_zalloc()without__GFP_NOFAILmay fail.btrfs use
kmem_cache_zalloc()withGFP_NOFSmostly, and only few place with__GFP_NOFAIL.xfs use
kmem_cache_zalloc()with__GFP_NOFAILmostly.It is very difficult to test all case of failure in
kmem_cache_zalloc().Should btrfs use
kmem_cache_zalloc()with__GFP_NOFAILjust like xfs or use mempool with pre-alloc to prevent fail?I tried both way.
1) add
__GFP_NOFAILtokmem_cache_zalloc()see 0001-btrfs-add-__GFP_NOFAIL-to-kmem_cache.patchbut this problem still happened in test.
Quoted 6 lines
2) switch to use
mempool_tforbtrfs_path
see 0001-btrfs-switch-to-mempool_t-for-btrfs_path.patchthis problem yet not happen in test.
But the memory alloc failure is difficult to test, we need more review.
more test result show that this problem still happen with the mempool_t patch.
with more source check, we found out this info is wrong
Quoted 5 lines
these callstack have a same root failure.
structbtrfs_path*btrfs_alloc_path(void){ return kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS); }
Best Regards
Wang Yugui ([email protected])
2021/03/29
From adfdc423f80ab379f14751ac9e9cdf11b2e201fd Mon Sep 17 00:00:00 2001
From: wangyugui <[email protected]>
Date: Tue, 30 Mar 2021 14:02:52 +0800
Subject: [PATCH] btrfs: dump_stack when ENOMEM
--- fs/btrfs/acl.c | 4 +- fs/btrfs/backref.c | 34 ++++----- fs/btrfs/block-group.c | 22 +++--- fs/btrfs/check-integrity.c | 8 +- fs/btrfs/compression.c | 4 +- fs/btrfs/ctree.c | 32 ++++---- fs/btrfs/delayed-inode.c | 20 ++--- fs/btrfs/delayed-ref.c | 16 ++-- fs/btrfs/dev-replace.c | 8 +- fs/btrfs/dir-item.c | 4 +- fs/btrfs/disk-io.c | 35 +++++---- fs/btrfs/export.c | 4 +- fs/btrfs/extent-tree.c | 30 ++++---- fs/btrfs/extent_io.c | 28 +++---- fs/btrfs/extent_map.c | 2 +- fs/btrfs/file-item.c | 10 +-- fs/btrfs/file.c | 18 ++--- fs/btrfs/free-space-cache.c | 22 +++--- fs/btrfs/free-space-tree.c | 20 ++--- fs/btrfs/inode-item.c | 8 +- fs/btrfs/inode.c | 70 ++++++++--------- fs/btrfs/ioctl.c | 44 +++++------ fs/btrfs/lzo.c | 8 +- fs/btrfs/ordered-data.c | 4 +- fs/btrfs/orphan.c | 4 +- fs/btrfs/props.c | 4 +- fs/btrfs/qgroup.c | 54 ++++++------- fs/btrfs/raid56.c | 10 +-- fs/btrfs/reada.c | 4 +- fs/btrfs/ref-verify.c | 14 ++-- fs/btrfs/reflink.c | 7 +- fs/btrfs/relocation.c | 42 +++++------ fs/btrfs/root-tree.c | 10 +-- fs/btrfs/scrub.c | 36 ++++----- fs/btrfs/send.c | 146 ++++++++++++++++++------------------ fs/btrfs/space-info.c | 2 +- fs/btrfs/subpage.c | 2 +- fs/btrfs/super.c | 26 +++---- fs/btrfs/sysfs.c | 14 ++-- fs/btrfs/transaction.c | 6 +- fs/btrfs/tree-defrag.c | 2 +- fs/btrfs/tree-log.c | 66 ++++++++-------- fs/btrfs/ulist.c | 2 +- fs/btrfs/uuid-tree.c | 8 +- fs/btrfs/volumes.c | 72 +++++++++--------- fs/btrfs/xattr.c | 8 +- fs/btrfs/zlib.c | 10 +-- fs/btrfs/zoned.c | 14 ++-- fs/btrfs/zstd.c | 10 +-- 49 files changed, 518 insertions(+), 510 deletions(-)
fs/btrfs/acl.c +2 -2
@@ -38,7 +38,7 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)if (size >0 ) { value =kzalloc (size,GFP_KERNEL );if (!value) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} size =btrfs_getxattr (inode, name, value, size); }if (size >0 )
@@ -84,7 +84,7 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans, value =kmalloc (size,GFP_KERNEL );memalloc_nofs_restore (nofs_flag);if (!value) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
fs/btrfs/backref.c +17 -17
@@ -52,7 +52,7 @@ static int check_extent_in_eb(const struct btrfs_key *key, e =kmalloc (sizeof (*e),GFP_NOFS );if (!e) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} e->next = *eie; e->inum = key->objectid;
@@ -154,7 +154,7 @@ int __init btrfs_prelim_ref_init(void)SLAB_MEM_SPREAD , NULL);if (!btrfs_prelim_ref_cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}return 0 ; }
@@ -345,7 +345,7 @@ static int add_prelim_ref(const struct btrfs_fs_info *fs_info, ref =kmem_cache_alloc (btrfs_prelim_ref_cache, gfp_mask);if (!ref) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ref->root_id = root_id;if (key)
@@ -677,7 +677,7 @@ static int resolve_indirect_refs(struct btrfs_fs_info *fs_info, parents =ulist_alloc (GFP_NOFS );if (!parents) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}/* * We could trade memory usage for performance here by iterating
@@ -740,7 +740,7 @@ static int resolve_indirect_refs(struct btrfs_fs_info *fs_info, GFP_NOFS);if (!new_ref) {free_pref (ref); - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }memcpy (new_ref, ref,sizeof (*ref));
@@ -1193,7 +1193,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (!trans) { path->search_commit_root =1 ; path->skip_locking =1 ;
@@ -1419,7 +1419,7 @@ int btrfs_find_all_leafs(struct btrfs_trans_handle *trans, *leafs =ulist_alloc (GFP_NOFS );if (!*leafs) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =find_parent_nodes (trans, fs_info, bytenr, time_seq, *leafs,NULL , extent_item_pos,NULL , ignore_offset);
@@ -1456,11 +1456,11 @@ static int btrfs_find_all_roots_safe(struct btrfs_trans_handle *trans, tmp =ulist_alloc (GFP_NOFS );if (!tmp) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} *roots =ulist_alloc (GFP_NOFS );if (!*roots) {ulist_free (tmp); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }ULIST_ITER_INIT (&uiter);
@@ -2078,7 +2078,7 @@ static int iterate_inode_refs(u64 inum, struct btrfs_root *fs_root, slot = path->slots[0 ]; eb =btrfs_clone_extent_buffer (path->nodes[0 ]);if (!eb) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;}break ; }btrfs_release_path (path);
@@ -2137,7 +2137,7 @@ static int iterate_inode_extrefs(u64 inum, struct btrfs_root *fs_root, slot = path->slots[0 ]; eb =btrfs_clone_extent_buffer (path->nodes[0 ]);if (!eb) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;}break ; }btrfs_release_path (path);
@@ -2250,7 +2250,7 @@ struct btrfs_data_container *init_data_container(u32 total_bytes) alloc_bytes =max_t (size_t, total_bytes,sizeof (*data)); data =kvmalloc (alloc_bytes,GFP_KERNEL );if (!data) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );}if (total_bytes >=sizeof (*data)) { data->bytes_left = total_bytes -sizeof (*data);
@@ -2285,7 +2285,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root, ifp =kmalloc (sizeof (*ifp),GFP_KERNEL );if (!ifp) {kvfree (fspath); -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} } ifp->btrfs_path = path;
@@ -2638,7 +2638,7 @@ static int handle_direct_tree_backref(struct btrfs_backref_cache *cache, edge =btrfs_backref_alloc_edge (cache);if (!edge) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} rb_node =rb_simple_search (&cache->rb_root, ref_key->offset);if (!rb_node) {
@@ -2647,7 +2647,7 @@ static int handle_direct_tree_backref(struct btrfs_backref_cache *cache, cur->level + 1);if (!upper) {btrfs_backref_free_edge (cache, edge); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }/*
@@ -2768,7 +2768,7 @@ static int handle_indirect_tree_backref(struct btrfs_backref_cache *cache, edge =btrfs_backref_alloc_edge (cache);if (!edge) {btrfs_put_root (root); - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -2780,7 +2780,7 @@ static int handle_indirect_tree_backref(struct btrfs_backref_cache *cache,if (!upper) {btrfs_put_root (root);btrfs_backref_free_edge (cache, edge); - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } upper->owner =btrfs_header_owner (eb);
fs/btrfs/block-group.c +11 -11
@@ -524,7 +524,7 @@ static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} last =max_t (u64, block_group->start,BTRFS_SUPER_INFO_OFFSET );
@@ -731,7 +731,7 @@ int btrfs_cache_block_group(struct btrfs_block_group *cache, int load_cache_only caching_ctl =kzalloc (sizeof (*caching_ctl),GFP_NOFS );if (!caching_ctl) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}INIT_LIST_HEAD (&caching_ctl->list);mutex_init (&caching_ctl->mutex);
@@ -905,7 +905,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -1633,7 +1633,7 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start, buf =kcalloc (map->num_stripes,sizeof (u64),GFP_NOFS );if (!buf) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -1857,7 +1857,7 @@ static int read_one_block_group(struct btrfs_fs_info *info, cache =btrfs_create_block_group_cache (info, key->objectid);if (!cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} cache->length = key->offset; cache->used =btrfs_stack_block_group_used (bgi);
@@ -1979,7 +1979,7 @@ static int fill_dummy_bgs(struct btrfs_fs_info *fs_info) map = em->map_lookup; bg =btrfs_create_block_group_cache (fs_info, em->start);if (!bg) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;}break ; }
@@ -2026,7 +2026,7 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info) key.type =BTRFS_BLOCK_GROUP_ITEM_KEY ; path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} cache_gen =btrfs_super_cache_generation (info->super_copy); if (btrfs_test_opt(info, SPACE_CACHE) &&
@@ -2200,7 +2200,7 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans, u64 bytes_used, cache =btrfs_create_block_group_cache (fs_info, chunk_offset);if (!cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} cache->length = size;set_free_space_tree_thresholds (cache);
@@ -2598,7 +2598,7 @@ int btrfs_setup_space_cache(struct btrfs_trans_handle *trans) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}/* Could add new block groups, use _safe just in case */ list_for_each_entry_safe(cache, tmp, &cur_trans->dirty_bgs,
@@ -2651,7 +2651,7 @@ again:if (!path) { path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } }
@@ -2804,7 +2804,7 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}/* * Even though we are in the critical section of the transaction commit,
fs/btrfs/check-integrity.c +4 -4
@@ -631,7 +631,7 @@ static int btrfsic_process_superblock(struct btrfsic_state *state, selected_super =kzalloc (sizeof (*selected_super),GFP_NOFS );if (!selected_super) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}list_for_each_entry (device, dev_head, dev_list) {int i;
@@ -1597,7 +1597,7 @@ static int btrfsic_read_block(struct btrfsic_state *state, size =sizeof (*block_ctx->datav) +sizeof (*block_ctx->pagev); block_ctx->mem_to_free =kcalloc (num_pages, size,GFP_NOFS );if (!block_ctx->mem_to_free) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} block_ctx->datav = block_ctx->mem_to_free; block_ctx->pagev = (struct page **)(block_ctx->datav + num_pages);for (i =0 ; i < num_pages; i++) {
@@ -2782,7 +2782,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, } state =kvzalloc (sizeof (*state),GFP_KERNEL );if (!state) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (!btrfsic_is_initialized) {mutex_init (&btrfsic_mutex);
@@ -2811,7 +2811,7 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info, ds =btrfsic_dev_state_alloc ();if (NULL == ds) {mutex_unlock (&btrfsic_mutex); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } ds->bdev = device->bdev; ds->state = state;
fs/btrfs/compression.c +2 -2
@@ -867,7 +867,7 @@ static struct list_head *alloc_heuristic_ws(unsigned int level) ws =kzalloc (sizeof (*ws),GFP_KERNEL );if (!ws) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} ws->sample =kvmalloc (MAX_SAMPLE_SIZE ,GFP_KERNEL );if (!ws->sample)
@@ -885,7 +885,7 @@ static struct list_head *alloc_heuristic_ws(unsigned int level)return &ws->list; fail:free_heuristic_ws (&ws->list); -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} }const struct btrfs_compress_op btrfs_heuristic_compress = {
fs/btrfs/ctree.c +16 -16
@@ -464,7 +464,7 @@ static noinline int tree_mod_log_insert_key(struct extent_buffer *eb, int slot, tm =alloc_tree_mod_elem (eb, slot, op, flags);if (!tm) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (tree_mod_dont_log (eb->fs_info, eb)) {kfree (tm);
@@ -493,11 +493,11 @@ static noinline int tree_mod_log_insert_move(struct extent_buffer *eb, tm_list =kcalloc (nr_items,sizeof (struct tree_mod_elem *),GFP_NOFS );if (!tm_list) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} tm =kzalloc (sizeof (*tm),GFP_NOFS );if (!tm) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; }
@@ -511,7 +511,7 @@ static noinline int tree_mod_log_insert_move(struct extent_buffer *eb, tm_list[i] =alloc_tree_mod_elem (eb, i + dst_slot,MOD_LOG_KEY_REMOVE_WHILE_MOVING ,GFP_NOFS );if (!tm_list[i]) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; } }
@@ -591,14 +591,14 @@ static noinline int tree_mod_log_insert_root(struct extent_buffer *old_root, tm_list =kcalloc (nritems,sizeof (struct tree_mod_elem *),GFP_NOFS );if (!tm_list) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; }for (i =0 ; i < nritems; i++) { tm_list[i] =alloc_tree_mod_elem (old_root, i,MOD_LOG_KEY_REMOVE_WHILE_FREEING ,GFP_NOFS );if (!tm_list[i]) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; } }
@@ -606,7 +606,7 @@ static noinline int tree_mod_log_insert_root(struct extent_buffer *old_root, tm =kzalloc (sizeof (*tm),GFP_NOFS );if (!tm) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; }
@@ -727,7 +727,7 @@ static noinline int tree_mod_log_eb_copy(struct extent_buffer *dst, tm_list =kcalloc (nr_items *2 ,sizeof (struct tree_mod_elem *),GFP_NOFS );if (!tm_list) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} tm_list_add = tm_list; tm_list_rem = tm_list + nr_items;
@@ -735,14 +735,14 @@ static noinline int tree_mod_log_eb_copy(struct extent_buffer *dst, tm_list_rem[i] =alloc_tree_mod_elem (src, i + src_offset,MOD_LOG_KEY_REMOVE ,GFP_NOFS );if (!tm_list_rem[i]) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; } tm_list_add[i] =alloc_tree_mod_elem (dst, i + dst_offset,MOD_LOG_KEY_ADD ,GFP_NOFS );if (!tm_list_add[i]) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; } }
@@ -794,13 +794,13 @@ static noinline int tree_mod_log_free_eb(struct extent_buffer *eb) nritems =btrfs_header_nritems (eb); tm_list =kcalloc (nritems,sizeof (struct tree_mod_elem *),GFP_NOFS );if (!tm_list) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}for (i =0 ; i < nritems; i++) { tm_list[i] =alloc_tree_mod_elem (eb, i,MOD_LOG_KEY_REMOVE_WHILE_FREEING ,GFP_NOFS );if (!tm_list[i]) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_tms; } }
@@ -2495,7 +2495,7 @@ static struct extent_buffer *btrfs_search_slot_get_root(struct btrfs_root *root, b =btrfs_clone_extent_buffer (root->commit_root);up_read (&fs_info->commit_root_sem);if (!b) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} }else { b = root->commit_root;
@@ -2918,7 +2918,7 @@ again:btrfs_tree_read_lock (b); b =tree_mod_log_rewind (fs_info, p, b, time_seq);if (!b) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto done; } p->locks[level] =BTRFS_READ_LOCK ;
@@ -4391,7 +4391,7 @@ static noinline int split_item(struct btrfs_path *path, buf =kmalloc (item_size,GFP_NOFS );if (!buf) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}read_extent_buffer (leaf, buf,btrfs_item_ptr_offset (leaf, path->slots[0 ]), item_size);
@@ -4816,7 +4816,7 @@ int btrfs_insert_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_insert_empty_item (trans, root, path, cpu_key, data_size);if (!ret) { leaf = path->nodes[0 ];
fs/btrfs/delayed-inode.c +10 -10
@@ -29,7 +29,7 @@ int __init btrfs_delayed_inode_init(void)SLAB_MEM_SPREAD , NULL);if (!delayed_node_cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}return 0 ; }
@@ -135,7 +135,7 @@ again: node =kmem_cache_zalloc (delayed_node_cache,GFP_NOFS );if (!node) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );}btrfs_init_delayed_node (node, root, ino);/* cached in the btrfs inode and can be accessed */
@@ -743,13 +743,13 @@ static int btrfs_batch_insert_items(struct btrfs_root *root, keys =kmalloc_array (nitems,sizeof (struct btrfs_key ),GFP_NOFS );if (!keys) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } data_size =kmalloc_array (nitems,sizeof (u32),GFP_NOFS );if (!data_size) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto error; }
@@ -1147,7 +1147,7 @@ static int __btrfs_run_delayed_items(struct btrfs_trans_handle *trans, int nr) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} block_rsv = trans->block_rsv; trans->block_rsv = &fs_info->delayed_block_rsv;
@@ -1210,7 +1210,7 @@ int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) {btrfs_release_delayed_node (delayed_node); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } block_rsv = trans->block_rsv;
@@ -1253,7 +1253,7 @@ int btrfs_commit_inode_delayed_inode(struct btrfs_inode *inode) path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto trans_out; }
@@ -1364,7 +1364,7 @@ static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root, async_work =kmalloc (sizeof (*async_work),GFP_NOFS );if (!async_work) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} async_work->delayed_root = delayed_root; btrfs_init_work(&async_work->work, btrfs_async_run_delayed_root, NULL,
@@ -1437,7 +1437,7 @@ int btrfs_insert_delayed_dir_index(struct btrfs_trans_handle *trans, delayed_item =btrfs_alloc_delayed_item (sizeof (*dir_item) + name_len);if (!delayed_item) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto release_node; }
@@ -1518,7 +1518,7 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans, item =btrfs_alloc_delayed_item (0 );if (!item) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto end; }
fs/btrfs/delayed-ref.c +8 -8
@@ -953,12 +953,12 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,BUG_ON (extent_op && extent_op->is_data); ref =kmem_cache_alloc (btrfs_delayed_tree_ref_cachep,GFP_NOFS );if (!ref) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS );if (!head_ref) {kmem_cache_free (btrfs_delayed_tree_ref_cachep, ref); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
@@ -969,7 +969,7 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,if (!record) {kmem_cache_free (btrfs_delayed_tree_ref_cachep, ref);kmem_cache_free (btrfs_delayed_ref_head_cachep, head_ref); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } }
@@ -1046,7 +1046,7 @@ int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans,ASSERT (generic_ref->type ==BTRFS_REF_DATA && action); ref =kmem_cache_alloc (btrfs_delayed_data_ref_cachep,GFP_NOFS );if (!ref) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (parent) ref_type =BTRFS_SHARED_DATA_REF_KEY ;
@@ -1063,7 +1063,7 @@ int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans, head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS );if (!head_ref) {kmem_cache_free (btrfs_delayed_data_ref_cachep, ref); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
@@ -1075,7 +1075,7 @@ int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans,kmem_cache_free (btrfs_delayed_data_ref_cachep, ref);kmem_cache_free (btrfs_delayed_ref_head_cachep, head_ref); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } }
@@ -1123,7 +1123,7 @@ int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans, head_ref =kmem_cache_alloc (btrfs_delayed_ref_head_cachep,GFP_NOFS );if (!head_ref) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} init_delayed_ref_head(head_ref, NULL, bytenr, num_bytes, 0, 0, BTRFS_UPDATE_DELAYED_HEAD, extent_op->is_data,
@@ -1199,5 +1199,5 @@ int __init btrfs_delayed_ref_init(void)return 0 ; fail:btrfs_delayed_ref_exit (); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }
fs/btrfs/dev-replace.c +4 -4
@@ -86,7 +86,7 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info) path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -301,7 +301,7 @@ static int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, name =rcu_string_strdup (device_path,GFP_KERNEL );if (!name) {btrfs_free_device (device); - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto error; }rcu_assign_pointer (device->name, name);
@@ -372,7 +372,7 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans) path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } ret =btrfs_search_slot (trans, dev_root, &key, path,-1 ,1 );
@@ -511,7 +511,7 @@ static int mark_block_group_to_copy(struct btrfs_fs_info *fs_info, path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto unlock; }
fs/btrfs/dir-item.c +2 -2
@@ -126,7 +126,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, const char *name, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}btrfs_cpu_key_to_disk (&disk_key, location);
@@ -214,7 +214,7 @@ int btrfs_check_dir_item_collision(struct btrfs_root *root, u64 dir, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} key.objectid = dir; key.type =BTRFS_DIR_ITEM_KEY ;
fs/btrfs/disk-io.c +22 -13
@@ -88,7 +88,7 @@ int __init btrfs_end_io_wq_init(void)SLAB_MEM_SPREAD , NULL);if (!btrfs_end_io_wq_cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}return 0 ; }
@@ -1167,7 +1167,7 @@ struct btrfs_root *btrfs_alloc_dummy_root(struct btrfs_fs_info *fs_info) root =btrfs_alloc_root (fs_info,BTRFS_ROOT_TREE_OBJECTID ,GFP_KERNEL );if (!root) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );}/* We don't use the stripesize in selftest, set it as sectorsize */ root->alloc_bytenr =0 ;
@@ -1195,7 +1195,7 @@ struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, root =btrfs_alloc_root (fs_info, objectid,GFP_KERNEL );memalloc_nofs_restore (nofs_flag);if (!root) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} root->root_key.objectid = objectid; root->root_key.type =BTRFS_ROOT_ITEM_KEY ;
@@ -1257,7 +1257,7 @@ static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans, root =btrfs_alloc_root (fs_info,BTRFS_TREE_LOG_OBJECTID ,GFP_NOFS );if (!root) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} root->root_key.objectid =BTRFS_TREE_LOG_OBJECTID ; root->root_key.type =BTRFS_ROOT_ITEM_KEY ;
@@ -1368,7 +1368,7 @@ static struct btrfs_root *read_tree_root_path(struct btrfs_root *tree_root, root =btrfs_alloc_root (fs_info, key->objectid,GFP_NOFS );if (!root) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} ret =btrfs_find_root (tree_root, key, path, &root->root_item, &root->root_key);
@@ -1406,7 +1406,7 @@ struct btrfs_root *btrfs_read_tree_root(struct btrfs_root *tree_root, path =btrfs_alloc_path ();if (!path) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} root =read_tree_root_path (tree_root, path, key);btrfs_free_path (path);
@@ -1430,6 +1430,7 @@ static int btrfs_init_fs_root(struct btrfs_root *root, dev_t anon_dev) nofs_flag =memalloc_nofs_save (); ret =btrfs_drew_lock_init (&root->snapshot_lock);memalloc_nofs_restore (nofs_flag); +if (ret == -ENOMEM )printk ("ENOMEM btrfs_drew_lock_init\n" );if (ret) goto fail;
@@ -1447,6 +1448,7 @@ static int btrfs_init_fs_root(struct btrfs_root *root, dev_t anon_dev) btrfs_root_refs(&root->root_item) > 0) {if (!anon_dev) { ret =get_anon_bdev (&root->anon_dev); +if (ret == -ENOMEM )printk ("ENOMEM get_anon_bdev\n" );if (ret) goto fail; }else {
@@ -1456,6 +1458,7 @@ static int btrfs_init_fs_root(struct btrfs_root *root, dev_t anon_dev)mutex_lock (&root->objectid_mutex); ret =btrfs_init_root_free_objectid (root); +if (ret == -ENOMEM )printk ("ENOMEM btrfs_init_root_free_objectid\n" );if (ret) {mutex_unlock (&root->objectid_mutex); goto fail;
@@ -1610,6 +1613,7 @@ static struct btrfs_root *btrfs_get_root_ref(struct btrfs_fs_info *fs_info,int ret; root =btrfs_get_global_root (fs_info, objectid); +if (root ==ERR_PTR (-ENOMEM ))printk ("ENOMEM btrfs_get_global_root\n" );if (root)return root; again:
@@ -1621,6 +1625,7 @@ again:btrfs_put_root (root);return ERR_PTR (-ENOENT ); } +if (root ==ERR_PTR (-ENOMEM ))printk ("ENOMEM btrfs_lookup_fs_root\n" );return root; }
@@ -1628,6 +1633,7 @@ again: key.type =BTRFS_ROOT_ITEM_KEY ; key.offset = (u64)-1 ; root =btrfs_read_tree_root (fs_info->tree_root, &key); +if (root ==ERR_PTR (-ENOMEM ))printk ("ENOMEM btrfs_read_tree_root\n" );if (IS_ERR (root))return root;
@@ -1637,12 +1643,13 @@ again: } ret =btrfs_init_fs_root (root, anon_dev); +if (ret == -ENOMEM )printk ("ENOMEM btrfs_init_fs_root\n" );if (ret) goto fail; path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto fail; } key.objectid =BTRFS_ORPHAN_OBJECTID ;
@@ -1650,6 +1657,7 @@ again: key.offset = objectid; ret =btrfs_search_slot (NULL , fs_info->tree_root, &key, path,0 ,0 ); +if (ret == -ENOMEM )printk ("ENOMEM btrfs_search_slot\n" );btrfs_free_path (path);if (ret <0 ) goto fail;
@@ -1657,6 +1665,7 @@ again:set_bit (BTRFS_ROOT_ORPHAN_ITEM_INSERTED , &root->state); ret =btrfs_insert_fs_root (fs_info, root); +if (ret == -ENOMEM )printk ("ENOMEM btrfs_insert_fs_root\n" );if (ret) {btrfs_put_root (root);if (ret == -EEXIST )
@@ -2277,7 +2286,7 @@ int btrfs_init_workqueues(struct btrfs_fs_info *fs_info, fs_info->fixup_workers && fs_info->delayed_workers && fs_info->qgroup_rescan_workers && fs_info->discard_ctl.discard_workers)) { -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }return 0 ;
@@ -2318,7 +2327,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info, log_tree_root =btrfs_alloc_root (fs_info,BTRFS_TREE_LOG_OBJECTID ,GFP_KERNEL );if (!log_tree_root) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} log_tree_root->node = read_tree_block(fs_info, bytenr, BTRFS_TREE_LOG_OBJECTID,
@@ -2924,7 +2933,7 @@ static int init_mount_fs_info(struct btrfs_fs_info *fs_info, struct super_block fs_info->delayed_root =kmalloc (sizeof (struct btrfs_delayed_root ),GFP_KERNEL );if (!fs_info->delayed_root) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}btrfs_init_delayed_root (fs_info->delayed_root);if (sb_rdonly (sb))
@@ -3119,13 +3128,13 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device GFP_KERNEL); fs_info->chunk_root = chunk_root;if (!tree_root || !chunk_root) { - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto fail; } fs_info->btree_inode =new_inode (sb);if (!fs_info->btree_inode) { - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto fail; }mapping_set_gfp_mask (fs_info->btree_inode->i_mapping,GFP_NOFS );
@@ -4909,7 +4918,7 @@ int btrfs_init_root_free_objectid(struct btrfs_root *root) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} search_key.objectid =BTRFS_LAST_FREE_OBJECTID ; search_key.type =-1 ;
fs/btrfs/export.c +2 -2
@@ -145,7 +145,7 @@ struct dentry *btrfs_get_parent(struct dentry *child) path =btrfs_alloc_path ();if (!path) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );}if (btrfs_ino (BTRFS_I (dir)) ==BTRFS_FIRST_FREE_OBJECTID ) { key.objectid = root->root_key.objectid;
@@ -221,7 +221,7 @@ static int btrfs_get_name(struct dentry *parent, char *name, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (ino ==BTRFS_FIRST_FREE_OBJECTID ) { key.objectid =BTRFS_I (inode)->root->root_key.objectid;
fs/btrfs/extent-tree.c +15 -15
@@ -93,7 +93,7 @@ int btrfs_lookup_data_extent(struct btrfs_fs_info *fs_info, u64 start, u64 len) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} key.objectid = start; key.offset = len;
@@ -138,7 +138,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (!trans) { path->skip_locking =1 ;
@@ -1459,7 +1459,7 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}/* this will setup the path even if it fails to insert the back ref */ ret = insert_inline_extent_backref(trans, path, bytenr, num_bytes,
@@ -1586,7 +1586,7 @@ static int run_delayed_extent_op(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} key.objectid = head->bytenr;
@@ -2195,7 +2195,7 @@ int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans, extent_op =btrfs_alloc_delayed_extent_op ();if (!extent_op) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} extent_op->flags_to_set = flags; extent_op->update_flags = true;
@@ -2372,7 +2372,7 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} do { ret = check_committed_ref(root, path, objectid,
@@ -2965,7 +2965,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} is_data = owner_objectid >=BTRFS_FIRST_FREE_OBJECTID ;
@@ -4529,7 +4529,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_insert_empty_item (trans, fs_info->extent_root, path, ins, size);
@@ -4613,7 +4613,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_insert_empty_item (trans, fs_info->extent_root, path, &extent_key, size);
@@ -4859,7 +4859,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,if (root_objectid !=BTRFS_TREE_LOG_OBJECTID ) { extent_op =btrfs_alloc_delayed_extent_op ();if (!extent_op) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out_free_buf; }if (key)
@@ -5083,7 +5083,7 @@ static int check_ref_exists(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret = lookup_extent_backref(trans, path, &iref, bytenr, root->fs_info->nodesize, parent,
@@ -5522,14 +5522,14 @@ int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc) path =btrfs_alloc_path ();if (!path) { - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto out; } wc =kzalloc (sizeof (*wc),GFP_NOFS );if (!wc) {btrfs_free_path (path); - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto out; }
@@ -5768,12 +5768,12 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} wc =kzalloc (sizeof (*wc),GFP_NOFS );if (!wc) {btrfs_free_path (path); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }btrfs_assert_tree_locked (parent);
fs/btrfs/extent_io.c +14 -14
@@ -221,7 +221,7 @@ int __init extent_state_cache_init(void)sizeof (struct extent_state ),0 , SLAB_MEM_SPREAD, NULL);if (!extent_state_cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}return 0 ; }
@@ -231,7 +231,7 @@ int __init extent_io_init(void)sizeof (struct extent_buffer ),0 , SLAB_MEM_SPREAD, NULL);if (!extent_buffer_cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} if (bioset_init(&btrfs_bioset, BIO_POOL_SIZE, offsetof(struct btrfs_io_bio, bio),
@@ -249,7 +249,7 @@ free_bioset: free_buffer_cache:kmem_cache_destroy (extent_buffer_cache); extent_buffer_cache =NULL ; -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }void __cold extent_state_cache_exit (void )
@@ -1229,7 +1229,7 @@ again:*/ prealloc =alloc_extent_state (GFP_NOFS );if (!prealloc && !first_iteration) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }spin_lock (&tree->lock);
@@ -1250,7 +1250,7 @@ again:if (!node) { prealloc =alloc_extent_state_atomic (prealloc);if (!prealloc) { - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto out; } err = insert_state(tree, prealloc, start, end,
@@ -1304,7 +1304,7 @@ hit_next:if (state->start < start) { prealloc =alloc_extent_state_atomic (prealloc);if (!prealloc) { - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto out; } err =split_state (tree, state, prealloc, start);
@@ -1343,7 +1343,7 @@ hit_next: prealloc =alloc_extent_state_atomic (prealloc);if (!prealloc) { - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto out; }
@@ -1369,7 +1369,7 @@ hit_next:if (state->start <= end && state->end > end) { prealloc =alloc_extent_state_atomic (prealloc);if (!prealloc) { - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto out; }
@@ -2476,7 +2476,7 @@ static struct io_failure_record *btrfs_get_io_failure_record(struct inode *inode failrec =kzalloc (sizeof (*failrec),GFP_NOFS );if (!failrec) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} failrec->start = start; failrec->len = end - start +1 ;
@@ -5001,12 +5001,12 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} roots =ulist_alloc (GFP_KERNEL ); tmp_ulist =ulist_alloc (GFP_KERNEL );if (!roots || !tmp_ulist) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out_free_ulist; }
@@ -5513,7 +5513,7 @@ struct extent_buffer *alloc_test_extent_buffer(struct btrfs_fs_info *fs_info,return eb; eb =alloc_dummy_extent_buffer (fs_info, start);if (!eb) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} eb->fs_info = fs_info; again: ret =radix_tree_preload (GFP_NOFS );
@@ -5608,7 +5608,7 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, eb =__alloc_extent_buffer (fs_info, start, len);if (!eb) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );}btrfs_set_buffer_lockdep_class (owner_root, eb, level); num_pages =num_extent_pages (eb);
@@ -5617,7 +5617,7 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, p =find_or_create_page (mapping, index,GFP_NOFS |__GFP_NOFAIL);if (!p) { - exists =ERR_PTR (-ENOMEM ); + exists =ERR_PTR (-ENOMEM );dump_stack (); goto free_eb; }
fs/btrfs/extent_map.c +1 -1
@@ -17,7 +17,7 @@ int __init extent_map_init(void)sizeof (struct extent_map ),0 , SLAB_MEM_SPREAD, NULL);if (!extent_map_cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}return 0 ; }
fs/btrfs/file-item.c +5 -5
@@ -143,7 +143,7 @@ int btrfs_insert_file_extent(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} file_key.objectid = objectid; file_key.offset = pos; file_key.type =BTRFS_EXTENT_DATA_KEY ;
@@ -513,7 +513,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (search_commit) { path->skip_locking =1 ;
@@ -576,7 +576,7 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, sums =kzalloc (btrfs_ordered_sum_size (fs_info, size),GFP_NOFS );if (!sums) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto fail; }
@@ -796,7 +796,7 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}while (1 ) { key.objectid =BTRFS_EXTENT_CSUM_OBJECTID ;
@@ -946,7 +946,7 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} again: next_offset = (u64)-1 ; found_next =0 ;
fs/btrfs/file.c +9 -9
@@ -153,7 +153,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, defrag =kmem_cache_zalloc (btrfs_inode_defrag_cachep,GFP_NOFS );if (!defrag) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} defrag->ino =btrfs_ino (inode); defrag->transid = transid;
@@ -720,7 +720,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,if (!path) { path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } }
@@ -1099,7 +1099,7 @@ int btrfs_mark_extent_written(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} again: recow =0 ; split = start;
@@ -1365,7 +1365,7 @@ again: mask | __GFP_WRITE);if (!pages[i]) { faili = i -1 ; - err = -ENOMEM ; + {dump_stack (); err = -ENOMEM ;} goto fail; }
@@ -1673,7 +1673,7 @@ static noinline ssize_t btrfs_buffered_write(struct kiocb *iocb, nrptrs =max (nrptrs,8 ); pages =kmalloc_array (nrptrs,sizeof (struct page *),GFP_KERNEL );if (!pages) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -2626,7 +2626,7 @@ int btrfs_replace_file_extents(struct inode *inode, struct btrfs_path *path, rsv =btrfs_alloc_block_rsv (fs_info,BTRFS_BLOCK_RSV_TEMP );if (!rsv) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } rsv->size =btrfs_calc_insert_metadata_size (fs_info,1 );
@@ -2962,7 +2962,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -3045,7 +3045,7 @@ static int add_falloc_range(struct list_head *head, u64 start, u64 len) insert: range =kmalloc (sizeof (*range),GFP_KERNEL );if (!range) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} range->start = start; range->len = len;list_add_tail (&range->list, head);
@@ -3670,7 +3670,7 @@ int __init btrfs_auto_defrag_init(void)SLAB_MEM_SPREAD , NULL);if (!btrfs_inode_defrag_cachep) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}return 0 ; }
fs/btrfs/free-space-cache.c +11 -11
@@ -221,7 +221,7 @@ int btrfs_remove_free_space_inode(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (!inode) inode =lookup_free_space_inode (block_group, path);
@@ -296,7 +296,7 @@ int btrfs_truncate_free_space_cache(struct btrfs_trans_handle *trans,struct btrfs_path *path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto fail; } locked = true;
@@ -373,7 +373,7 @@ static int io_ctl_init(struct btrfs_io_ctl *io_ctl, struct inode *inode, io_ctl->pages =kcalloc (num_pages,sizeof (struct page *),GFP_NOFS );if (!io_ctl->pages) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} io_ctl->num_pages = num_pages; io_ctl->fs_info =btrfs_sb (inode->i_sb);
@@ -436,7 +436,7 @@ static int io_ctl_prepare_pages(struct btrfs_io_ctl *io_ctl, bool uptodate) page =find_or_create_page (inode->i_mapping, i, mask);if (!page) {io_ctl_drop_pages (io_ctl); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } ret =set_page_extent_mapped (page);
@@ -785,7 +785,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, e =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS );if (!e) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto free_cache; }
@@ -817,7 +817,7 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, e->bitmap =kmem_cache_zalloc ( btrfs_free_space_bitmap_cachep,GFP_NOFS );if (!e->bitmap) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;}kmem_cache_free ( btrfs_free_space_cachep, e); goto free_cache;
@@ -2242,7 +2242,7 @@ new_bitmap: GFP_NOFS);if (!info) {spin_lock (&ctl->tree_lock); - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } }
@@ -2253,7 +2253,7 @@ new_bitmap: info->trim_state =BTRFS_TRIM_STATE_TRIMMED ;spin_lock (&ctl->tree_lock);if (!info->bitmap) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } goto again;
@@ -2481,7 +2481,7 @@ int __btrfs_add_free_space(struct btrfs_fs_info *fs_info, info =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS );if (!info) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} info->offset = offset; info->bytes = bytes;
@@ -4014,7 +4014,7 @@ again:if (!info) { info =kmem_cache_zalloc (btrfs_free_space_cachep,GFP_NOFS );if (!info) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }if (!bitmap) {
@@ -4033,7 +4033,7 @@ again: map =kmem_cache_zalloc (btrfs_free_space_bitmap_cachep,GFP_NOFS );if (!map) {kmem_cache_free (btrfs_free_space_cachep, info); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } }
fs/btrfs/free-space-tree.c +10 -10
@@ -204,7 +204,7 @@ int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, bitmap_size =free_space_bitmap_size (fs_info, block_group->length); bitmap =alloc_bitmap (bitmap_size);if (!bitmap) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -341,7 +341,7 @@ int convert_free_space_to_extents(struct btrfs_trans_handle *trans, bitmap_size =free_space_bitmap_size (fs_info, block_group->length); bitmap =alloc_bitmap (bitmap_size);if (!bitmap) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -822,7 +822,7 @@ int remove_from_free_space_tree(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -1015,7 +1015,7 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -1054,13 +1054,13 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} path->reada =READA_FORWARD ; path2 =btrfs_alloc_path ();if (!path2) {btrfs_free_path (path); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } ret =add_new_free_space_info (trans, block_group, path2);
@@ -1199,7 +1199,7 @@ static int clear_free_space_tree(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} key.objectid =0 ; key.type =0 ;
@@ -1302,7 +1302,7 @@ int add_block_group_free_space(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -1337,7 +1337,7 @@ int remove_block_group_free_space(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -1547,7 +1547,7 @@ int load_free_space_tree(struct btrfs_caching_control *caching_ctl) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}/* * Just like caching_thread() doesn't want to deadlock on the extent
fs/btrfs/inode-item.c +4 -4
@@ -117,7 +117,7 @@ static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_search_slot (trans, root, &key, path,-1 ,1 );if (ret >0 )
@@ -189,7 +189,7 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_search_slot (trans, root, &key, path,-1 ,1 );if (ret >0 ) {
@@ -264,7 +264,7 @@ static int btrfs_insert_inode_extref(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_insert_empty_item (trans, root, path, &key, ins_len);
@@ -320,7 +320,7 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} path->skip_release_on_error =1 ; ret = btrfs_insert_empty_item(trans, root, path, &key,
fs/btrfs/inode.c +35 -35
277 lines not on this page · raw message
fs/btrfs/ioctl.c +22 -22
172 lines not on this page · raw message
fs/btrfs/lzo.c +4 -4
@@ -79,7 +79,7 @@ struct list_head *lzo_alloc_workspace(unsigned int level) workspace =kzalloc (sizeof (*workspace),GFP_KERNEL );if (!workspace) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} workspace->mem =kvmalloc (LZO1X_MEM_COMPRESS ,GFP_KERNEL ); workspace->buf =kvmalloc (lzo1x_worst_compress (PAGE_SIZE ),GFP_KERNEL );
@@ -92,7 +92,7 @@ struct list_head *lzo_alloc_workspace(unsigned int level)return &workspace->list; fail:lzo_free_workspace (&workspace->list); -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} }static inline void write_compress_length (char *buf,size_t len)
@@ -148,7 +148,7 @@ int lzo_compress_pages(struct list_head *ws, struct address_space *mapping,*/ out_page =alloc_page (GFP_NOFS | __GFP_HIGHMEM);if (out_page ==NULL ) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } cpage_out =kmap (out_page);
@@ -218,7 +218,7 @@ int lzo_compress_pages(struct list_head *ws, struct address_space *mapping, out_page =alloc_page (GFP_NOFS | __GFP_HIGHMEM);if (out_page ==NULL ) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } cpage_out =kmap (out_page);
fs/btrfs/ordered-data.c +2 -2
@@ -188,7 +188,7 @@ static int __btrfs_add_ordered_extent(struct btrfs_inode *inode, u64 file_offset } entry =kmem_cache_zalloc (btrfs_ordered_extent_cache,GFP_NOFS );if (!entry) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} entry->file_offset = file_offset; entry->disk_bytenr = disk_bytenr;
@@ -1009,7 +1009,7 @@ int __init ordered_data_init(void)SLAB_MEM_SPREAD , NULL);if (!btrfs_ordered_extent_cache) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}return 0 ; }
fs/btrfs/orphan.c +2 -2
@@ -19,7 +19,7 @@ int btrfs_insert_orphan_item(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_insert_empty_item (trans, root, path, &key,0 );
@@ -40,7 +40,7 @@ int btrfs_del_orphan_item(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_search_slot (trans, root, &key, path,-1 ,1 );if (ret <0 )
fs/btrfs/props.c +2 -2
@@ -181,7 +181,7 @@ static int iterate_object_props(struct btrfs_root *root, name_buf_len = name_len +1 ; name_buf =kmalloc (name_buf_len,GFP_NOFS );if (!name_buf) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } }
@@ -197,7 +197,7 @@ static int iterate_object_props(struct btrfs_root *root, value_buf_len = data_len; value_buf =kmalloc (data_len,GFP_NOFS );if (!value_buf) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; } }
fs/btrfs/qgroup.c +27 -27
212 lines not on this page · raw message
fs/btrfs/raid56.c +5 -5
@@ -219,7 +219,7 @@ int btrfs_alloc_stripe_hash_table(struct btrfs_fs_info *info)*/ table =kvzalloc (struct_size (table, table, num_entries),GFP_KERNEL );if (!table) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}spin_lock_init (&table->cache_lock);INIT_LIST_HEAD (&table->stripe_cache);
@@ -979,7 +979,7 @@ static struct btrfs_raid_bio *alloc_rbio(struct btrfs_fs_info *fs_info,BITS_TO_LONGS (stripe_npages), GFP_NOFS);if (!rbio) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );}bio_list_init (&rbio->bio_list);INIT_LIST_HEAD (&rbio->plug_list);
@@ -1036,7 +1036,7 @@ static int alloc_rbio_pages(struct btrfs_raid_bio *rbio)continue ; page =alloc_page (GFP_NOFS | __GFP_HIGHMEM);if (!page) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} rbio->stripe_pages[i] = page; }return 0 ;
@@ -1055,7 +1055,7 @@ static int alloc_rbio_parity_pages(struct btrfs_raid_bio *rbio)continue ; page =alloc_page (GFP_NOFS | __GFP_HIGHMEM);if (!page) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} rbio->stripe_pages[i] = page; }return 0 ;
@@ -2300,7 +2300,7 @@ static int alloc_rbio_essential_pages(struct btrfs_raid_bio *rbio) page =alloc_page (GFP_NOFS | __GFP_HIGHMEM);if (!page) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} rbio->stripe_pages[index] = page; } }
fs/btrfs/reada.c +2 -2
@@ -572,7 +572,7 @@ static int reada_add_block(struct reada_control *rc, u64 logical, rec =kzalloc (sizeof (*rec),GFP_KERNEL );if (!rec) {reada_extent_put (fs_info, re); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } rec->rc = rc;
@@ -969,7 +969,7 @@ struct reada_control *btrfs_reada_add(struct btrfs_root *root, rc =kzalloc (sizeof (*rc),GFP_KERNEL );if (!rc) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} rc->fs_info = root->fs_info; rc->key_start = *key_start;
fs/btrfs/ref-verify.c +7 -7
@@ -269,7 +269,7 @@ static struct block_entry *add_block_entry(struct btrfs_fs_info *fs_info,if (!be || !re) {kfree (re);kfree (be); -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} } be->bytenr = bytenr; be->len = len;
@@ -315,7 +315,7 @@ static int add_tree_block(struct btrfs_fs_info *fs_info, u64 ref_root, ref =kmalloc (sizeof (struct ref_entry ),GFP_KERNEL );if (!ref) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;}if (parent) ref->root_objectid =0 ;
@@ -360,7 +360,7 @@ static int add_shared_data_ref(struct btrfs_fs_info *fs_info, ref =kzalloc (sizeof (struct ref_entry ),GFP_KERNEL );if (!ref) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} be =add_block_entry (fs_info, bytenr, num_bytes,0 );if (IS_ERR (be)) {kfree (ref);
@@ -395,7 +395,7 @@ static int add_extent_data_ref(struct btrfs_fs_info *fs_info, ref =kzalloc (sizeof (struct ref_entry ),GFP_KERNEL );if (!ref) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} be =add_block_entry (fs_info, bytenr, num_bytes, ref_root);if (IS_ERR (be)) {kfree (ref);
@@ -692,7 +692,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,if (!ra || !ref) {kfree (ref);kfree (ra); - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }
@@ -766,7 +766,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,if (!re) {kfree (ref);kfree (ra); - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out; }/*
@@ -983,7 +983,7 @@ int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} eb =btrfs_read_lock_root_node (fs_info->extent_root); level =btrfs_header_level (eb);
fs/btrfs/reflink.c +3 -4
@@ -77,7 +77,7 @@ static int copy_inline_to_page(struct btrfs_inode *inode, page =find_or_create_page (mapping, file_offset >>PAGE_SHIFT ,btrfs_alloc_write_mask (mapping));if (!page) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;} goto out_unlock; }
@@ -334,15 +334,14 @@ static int btrfs_clone(struct inode *src, struct inode *inode,const u64 len = olen_aligned;u64 last_dest_end = destoff; - ret = -ENOMEM ; buf =kvmalloc (fs_info->nodesize,GFP_KERNEL );if (!buf) -return ret; + {dump_stack ();return -ENOMEM ; } path =btrfs_alloc_path ();if (!path) {kvfree (buf); -return ret; + {dump_stack ();return -ENOMEM ; } } path->reada =READA_FORWARD ;
fs/btrfs/relocation.c +21 -21
163 lines not on this page · raw message
fs/btrfs/root-tree.c +5 -5
@@ -129,7 +129,7 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_search_slot (trans, root, key, path,0 ,1 );if (ret <0 )
@@ -216,7 +216,7 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info) path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} key.objectid =BTRFS_ORPHAN_OBJECTID ; key.type =BTRFS_ORPHAN_ITEM_KEY ;
@@ -300,7 +300,7 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ret =btrfs_search_slot (trans, root, key, path,-1 ,1 );if (ret <0 ) goto out;
@@ -329,7 +329,7 @@ int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} key.objectid = root_id; key.type =BTRFS_ROOT_BACKREF_KEY ;
@@ -400,7 +400,7 @@ int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} key.objectid = root_id; key.type =BTRFS_ROOT_BACKREF_KEY ;
fs/btrfs/scrub.c +18 -18
@@ -346,7 +346,7 @@ static struct full_stripe_lock *insert_full_stripe_lock(*/ ret =kmalloc (sizeof (*ret),GFP_KERNEL );if (!ret) -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} ret->logical = fstripe_logical; ret->refs =1 ;mutex_init (&ret->mutex);
@@ -628,7 +628,7 @@ static noinline_for_stack struct scrub_ctx *scrub_setup_ctx( nomem:scrub_free_ctx (sctx); -return ERR_PTR (-ENOMEM ); + {dump_stack ();return ERR_PTR (-ENOMEM );} } static int scrub_print_warning_inode(u64 inum, u64 offset, u64 root,
@@ -1312,7 +1312,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,if (!recover) {btrfs_put_bbio (bbio);btrfs_bio_counter_dec (fs_info); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }refcount_set (&recover->refs,1 );
@@ -1338,7 +1338,7 @@ leave_nomem: sctx->stat.malloc_errors++;spin_unlock (&sctx->stat_lock);scrub_put_recover (fs_info, recover); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }scrub_page_get (spage); sblock->pagev[page_index] = spage;
@@ -1658,7 +1658,7 @@ again: GFP_KERNEL);if (!sctx->wr_curr_bio) {mutex_unlock (&sctx->wr_lock); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} } sctx->wr_curr_bio->sctx = sctx; sctx->wr_curr_bio->page_count =0 ;
@@ -2211,7 +2211,7 @@ static int scrub_pages(struct scrub_ctx *sctx, u64 logical, u32 len,spin_lock (&sctx->stat_lock); sctx->stat.malloc_errors++;spin_unlock (&sctx->stat_lock); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }/* one ref inside this function, plus one for each page added to
@@ -2236,7 +2236,7 @@ leave_nomem: sctx->stat.malloc_errors++;spin_unlock (&sctx->stat_lock);scrub_block_put (sblock); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }BUG_ON (index >=SCRUB_MAX_PAGES_PER_BLOCK );scrub_page_get (spage);
@@ -2549,7 +2549,7 @@ static int scrub_pages_for_parity(struct scrub_parity *sparity,spin_lock (&sctx->stat_lock); sctx->stat.malloc_errors++;spin_unlock (&sctx->stat_lock); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }/* one ref inside this function, plus one for each page added to
@@ -2570,7 +2570,7 @@ leave_nomem: sctx->stat.malloc_errors++;spin_unlock (&sctx->stat_lock);scrub_block_put (sblock); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }BUG_ON (index >=SCRUB_MAX_PAGES_PER_BLOCK );/* For scrub block */
@@ -2869,7 +2869,7 @@ static noinline_for_stack int scrub_raid56_parity(struct scrub_ctx *sctx,spin_lock (&sctx->stat_lock); sctx->stat.malloc_errors++;spin_unlock (&sctx->stat_lock); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }ASSERT (map->stripe_len <=U32_MAX );
@@ -3172,12 +3172,12 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} ppath =btrfs_alloc_path ();if (!ppath) {btrfs_free_path (path); -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} }/*
@@ -3613,7 +3613,7 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx, path =btrfs_alloc_path ();if (!path) -return -ENOMEM ; + {dump_stack ();return -ENOMEM ;} path->reada =READA_FORWARD ; path->search_commit_root =1 ;
@@ -3880,7 +3880,7 @@ skip_unfreeze:break ; }if (sctx->stat.malloc_errors >0 ) { - ret = -ENOMEM ; + {dump_stack (); ret = -ENOMEM ;}break ; } skip:
@@ -3964,7 +3964,7 @@ static noinline_for_stack int scrub_workers_get(struct btrfs_fs_info *fs_info,struct btrfs_workqueue *scrub_parity =NULL ;unsigned int flags =WQ_FREEZABLE |WQ_UNBOUND ;int max_active = fs_info->thread_pool_size; -int ret = -ENOMEM ; +int ret;if (refcount_inc_not_zero (&fs_info->scrub_workers_refcnt))return 0 ;
@@ -3972,17 +3972,17 @@ static noinline_for_stack int scrub_workers_get(struct btrfs_fs_info *fs_info, scrub_workers =btrfs_alloc_workqueue (fs_info,"scrub" , flags, is_dev_replace ?1 : max_active,4 );if (!scrub_workers) - goto fail_scrub_workers; + {dump_stack (); ret = -ENOMEM ; goto fail_scrub_workers; } scrub_wr_comp =btrfs_alloc_workqueue (fs_info,"scrubwrc" , flags, max_active,2 );if (!scrub_wr_comp) - goto fail_scrub_wr_completion_workers; + {dump_stack (); ret = -ENOMEM ; goto fail_scrub_wr_completion_workers;} scrub_parity =btrfs_alloc_workqueue (fs_info,"scrubparity" , flags, max_active,2 );if (!scrub_parity) - goto fail_scrub_parity_workers; + {dump_stack (); ret = -ENOMEM ; goto fail_scrub_parity_workers;}mutex_lock (&fs_info->scrub_lock);if (refcount_read (&fs_info->scrub_workers_refcnt) ==0 ) {
fs/btrfs/send.c +73 -73
457 lines not on this page · raw message
fs/btrfs/tree-log.c +33 -33
66 lines not on this page · raw message
fs/btrfs/volumes.c +36 -36
72 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.30.2
Part of the diff is not shown here. View the raw message.
Quoted 33 lines · Wang Yugui
Hi, Nikolay Borisov
With a lot of dump_stack()/printk inserted around ENOMEM in btrfs code, we find out the call stack for ENOMEM.
see the file 0000-btrfs-dump_stack-when-ENOMEM.patch#cat
/usr/hpc-bio/xfstests/results//generic/476.dmesg
...[ 5759.102929] ENOMEM btrfs_drew_lock_init [ 5759.102943] ENOMEM btrfs_init_fs_root [ 5759.102947] ------------[ cut here ]------------ [ 5759.102950] BTRFS: Transaction aborted (error -12) [ 5759.103052] WARNING: CPU: 14 PID: 2741468 at /ssd/hpc-bio/linux-5.10.27/fs/btrfs/transaction.c:1705 create_pending_snapshot+0xb8c/0xd50 [btrfs]...
btrfs_drew_lock_init()return-ENOMEM,
this is the source:/* * We might be called under a transaction (e.g. indirect backref * resolution) which could deadlock if it triggers memory reclaim */ nofs_flag = memalloc_nofs_save(); ret = btrfs_drew_lock_init(&root->snapshot_lock); memalloc_nofs_restore(nofs_flag); if (ret == -ENOMEM) printk("ENOMEM btrfs_drew_lock_init\n"); if (ret) goto fail;And the souce come from:
Quoted 8 lines
commit
dcc3eb9638c3c927f1597075e851d0a16300a876Author: Nikolay Borisov <[email protected]> Date: Thu Jan 30 14:59:45 2020 +0200btrfs: convert snapshot/nocow exlcusion to drew lock
Any advice to fix this ENOMEM problem?
This is likely coming from changed behavior in MM, doesn't seem related to btrfs. We have multiple places where nofs_save() is called. By the same token the failure might have occurred in any other place, in any other piece of code which uses memalloc_nofs_save, there is no indication that this is directly related to btrfs.
Quoted 6 lines
top command show that this server have engough memory.
The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swap
You are showing that the server has 192G of installed memory, you have not shown any stats which prove at the time of failure what is the state of the MM subsystem. At the very least at the time of failure inspect the output of :
cat /proc/meminfo
and "free -m" commands.
<snip>
H,
Quoted 61 lines · Wang Yugui
Quoted 33 lines
Hi, Nikolay Borisov
With a lot of dump_stack()/printk inserted around ENOMEM in btrfs code, we find out the call stack for ENOMEM.
see the file 0000-btrfs-dump_stack-when-ENOMEM.patch#cat
/usr/hpc-bio/xfstests/results//generic/476.dmesg
...[ 5759.102929] ENOMEM btrfs_drew_lock_init [ 5759.102943] ENOMEM btrfs_init_fs_root [ 5759.102947] ------------[ cut here ]------------ [ 5759.102950] BTRFS: Transaction aborted (error -12) [ 5759.103052] WARNING: CPU: 14 PID: 2741468 at /ssd/hpc-bio/linux-5.10.27/fs/btrfs/transaction.c:1705 create_pending_snapshot+0xb8c/0xd50 [btrfs]...
btrfs_drew_lock_init()return-ENOMEM,
this is the source:/* * We might be called under a transaction (e.g. indirect backref * resolution) which could deadlock if it triggers memory reclaim */ nofs_flag = memalloc_nofs_save(); ret = btrfs_drew_lock_init(&root->snapshot_lock); memalloc_nofs_restore(nofs_flag); if (ret == -ENOMEM) printk("ENOMEM btrfs_drew_lock_init\n"); if (ret) goto fail;And the souce come from:
Quoted 8 lines
commit
dcc3eb9638c3c927f1597075e851d0a16300a876Author: Nikolay Borisov <[email protected]> Date: Thu Jan 30 14:59:45 2020 +0200btrfs: convert snapshot/nocow exlcusion to drew lock
Any advice to fix this ENOMEM problem?
This is likely coming from changed behavior in MM, doesn't seem related to btrfs. We have multiple places where
nofs_save()is called. By the same token the failure might have occurred in any other place, in any other piece of code which usesmemalloc_nofs_save, there is no indication that this is directly related to btrfs.Quoted 6 lines
top command show that this server have engough memory.
The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swapYou are showing that the server has 192G of installed memory, you have not shown any stats which prove at the time of failure what is the state of the MM subsystem. At the very least at the time of failure inspect the output of :
Quoted 5 lines
cat
/proc/meminfoand "free -m" commands.
<snip>
Only one xfstest job is running in this server.
Best Regards
Wang Yugui ([email protected])
2021/03/30
Quoted 60 lines · On 30.03.2021 09:16 Wang Yugui wrote:
H,
Quoted 58 lines · Wang Yugui
Quoted 33 lines
Hi, Nikolay Borisov
With a lot of dump_stack()/printk inserted around ENOMEM in btrfs code, we find out the call stack for ENOMEM.
see the file 0000-btrfs-dump_stack-when-ENOMEM.patch#cat
/usr/hpc-bio/xfstests/results//generic/476.dmesg
...[ 5759.102929] ENOMEM btrfs_drew_lock_init [ 5759.102943] ENOMEM btrfs_init_fs_root [ 5759.102947] ------------[ cut here ]------------ [ 5759.102950] BTRFS: Transaction aborted (error -12) [ 5759.103052] WARNING: CPU: 14 PID: 2741468 at /ssd/hpc-bio/linux-5.10.27/fs/btrfs/transaction.c:1705 create_pending_snapshot+0xb8c/0xd50 [btrfs]...
btrfs_drew_lock_init()return-ENOMEM,
this is the source:/* * We might be called under a transaction (e.g. indirect backref * resolution) which could deadlock if it triggers memory reclaim */ nofs_flag = memalloc_nofs_save(); ret = btrfs_drew_lock_init(&root->snapshot_lock); memalloc_nofs_restore(nofs_flag); if (ret == -ENOMEM) printk("ENOMEM btrfs_drew_lock_init\n"); if (ret) goto fail;And the souce come from:
Quoted 8 lines
commit
dcc3eb9638c3c927f1597075e851d0a16300a876Author: Nikolay Borisov <[email protected]> Date: Thu Jan 30 14:59:45 2020 +0200btrfs: convert snapshot/nocow exlcusion to drew lock
Any advice to fix this ENOMEM problem?
This is likely coming from changed behavior in MM, doesn't seem related to btrfs. We have multiple places where
nofs_save()is called. By the same token the failure might have occurred in any other place, in any other piece of code which usesmemalloc_nofs_save, there is no indication that this is directly related to btrfs.Quoted 5 lines
top command show that this server have engough memory.
The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swapYou are showing that the server has 192G of installed memory, you have not shown any stats which prove at the time of failure what is the state of the MM subsystem. At the very least at the time of failure inspect the output of :
Quoted 6 lines
Quoted 5 lines
cat
/proc/meminfoand "free -m" commands.
<snip>
Only one xfstest job is running in this server.
Had what looks like the same issue happinging on a server:
[19146.391015] ------------[ cut here ]------------ [19146.391017] BTRFS: Transaction aborted (error -12) [19146.391035] WARNING: CPU: 13 PID: 1825871 at fs/btrfs/transaction.c:1684 create_pending_snapshot+0x912/0xd10 [19146.391036] Modules linked in: bcache crc64 loop dm_crypt bfq xfs dm_mod st sr_mod cdrom intel_powerclamp coretemp dcdbas kvm_intel snd_pcm snd_timer kvm snd irqbypass soundcore mgag200 serio_raw pcspkr drm_kms_helper evdev joydev iTCO_wdt iTCO_vendor_support i2c_algo_bit i7core_edac sg ipmi_si ipmi_devintf ipmi_msghandler wmi acpi_power_meter button ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi drm configfs ip_tables x_tables autofs4 raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear md_mod sd_mod hid_generic usbhid hid crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel crypto_simd ahci cryptd glue_helper mpt3sas libahci uhci_hcd ehci_pci psmouse ehci_hcd lpc_ich raid_class libata nvme scsi_transport_sas mfd_core usbcore nvme_core scsi_mod t10_pi bnx2 [19146.391092] CPU: 13 PID: 1825871 Comm: btrfs Tainted: G W I 5.10.26 #1 [19146.391093] Hardware name: Dell Inc. PowerEdge R510/0DPRKF, BIOS 1.14.0 05/30/2018 [19146.391095] RIP: 0010:create_pending_snapshot+0x912/0xd10 [19146.391097] Code: 48 0f ba aa 40 0a 00 00 02 72 28 83 f8 fb 74 48 83 f8 e2 74 43 89 c6 48 c7 c7 70 2d 10 82 48 89 85 78 ff ff ff e8 d5 65 55 00 <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 94 06 00 00 48 c7 c6 70 46 e4 [19146.391098] RSP: 0018:ffffc900201c3b00 EFLAGS: 00010286 [19146.391099] RAX: 0000000000000000 RBX: ffff8881ba393200 RCX: ffff88880fb98b88 [19146.391100] RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff88880fb98b80 [19146.391101] RBP: ffffc900201c3bd0 R08: ffffffff825e2148 R09: 0000000000027ffb [19146.391101] R10: 00000000ffff8000 R11: 3fffffffffffffff R12: ffff888119dd39c0 [19146.391102] R13: ffff888248c36800 R14: ffff888a1bf69800 R15: 00000000fffffff4 [19146.391103] FS: 00007f1d7c9488c0(0000) GS:ffff88880fb80000(0000) knlGS:0000000000000000 [19146.391104] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [19146.391105] CR2: 00007fffef58d000 CR3: 000000028c988004 CR4: 00000000000206e0 [19146.391106] Call Trace: [19146.391111] ? create_pending_snapshots+0xa2/0xc0 [19146.391112] create_pending_snapshots+0xa2/0xc0 [19146.391114] btrfs_commit_transaction+0x4b9/0xb40 [19146.391116] ? start_transaction+0xd2/0x580 [19146.391119] btrfs_mksubvol+0x29e/0x450 [19146.391122] btrfs_mksnapshot+0x7b/0xb0 [19146.391124] __btrfs_ioctl_snap_create+0x16f/0x180 [19146.391126] btrfs_ioctl_snap_create_v2+0xb3/0x130 [19146.391128] btrfs_ioctl+0x15f/0x3040 [19146.391131] ? __x64_sys_ioctl+0x83/0xb0 [19146.391132] __x64_sys_ioctl+0x83/0xb0 [19146.391136] do_syscall_64+0x33/0x80 [19146.391140] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [19146.391142] RIP: 0033:0x7f1d7ca3fcc7 [19146.391144] Code: 00 00 00 48 8b 05 c9 91 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 99 91 0c 00 f7 d8 64 89 01 48 [19146.391145] RSP: 002b:00007fffef5919b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [19146.391146] RAX: ffffffffffffffda RBX: 00007fffef5a4c78 RCX: 00007f1d7ca3fcc7 [19146.391147] RDX: 00007fffef5919d0 RSI: 0000000050009417 RDI: 0000000000000004 [19146.391148] RBP: 0000565259b4d910 R08: ffffffffffffffff R09: 0000565259b4d9e0 [19146.391148] R10: 0000000000000000 R11: 0000000000000246 R12: 0000565259b4b8d0 [19146.391149] R13: 000000000000000e R14: 0000565259b4d9e0 R15: 00007fffef5919d0 [19146.391151] ---[ end trace 3d3ae6fb9d3c0b49 ]--- [19146.391153] BTRFS: error (device sdo2) in create_pending_snapshot:1684: errno=-12 Out of memory [19146.391187] BTRFS info (device sdo2): forced readonly [19146.391190] BTRFS warning (device sdo2): Skipping commit of aborted transaction. [19146.391191] BTRFS: error (device sdo2) in cleanup_transaction:1942: errno=-12 Out of memory [44395.445834] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519 [44395.448248] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519 [44395.448512] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519 [44395.455324] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519
Hi,
This patch works.
From: Dennis Zhou <[email protected]> To: Wang Yugui <[email protected]> Cc: Vlastimil Babka <[email protected]>,
[email protected], [email protected]
Date: Thu, 8 Apr 2021 13:48:33 +0000
Subject: Re: unexpected -ENOMEM from percpu_counter_init()
----
Ah. Can you try the following patch?
https://lore.kernel.org/lkml/[email protected]/
Best Regards
Wang Yugui ([email protected])
2021/04/13
Quoted 119 lines · On 30.03.2021 09:16 Wang Yugui wrote:
Quoted 60 lines
H,
Quoted 58 lines · Wang Yugui
Quoted 33 lines
Hi, Nikolay Borisov
With a lot of dump_stack()/printk inserted around ENOMEM in btrfs code, we find out the call stack for ENOMEM.
see the file 0000-btrfs-dump_stack-when-ENOMEM.patch#cat
/usr/hpc-bio/xfstests/results//generic/476.dmesg
...[ 5759.102929] ENOMEM btrfs_drew_lock_init [ 5759.102943] ENOMEM btrfs_init_fs_root [ 5759.102947] ------------[ cut here ]------------ [ 5759.102950] BTRFS: Transaction aborted (error -12) [ 5759.103052] WARNING: CPU: 14 PID: 2741468 at /ssd/hpc-bio/linux-5.10.27/fs/btrfs/transaction.c:1705 create_pending_snapshot+0xb8c/0xd50 [btrfs]...
btrfs_drew_lock_init()return-ENOMEM,
this is the source:/* * We might be called under a transaction (e.g. indirect backref * resolution) which could deadlock if it triggers memory reclaim */ nofs_flag = memalloc_nofs_save(); ret = btrfs_drew_lock_init(&root->snapshot_lock); memalloc_nofs_restore(nofs_flag); if (ret == -ENOMEM) printk("ENOMEM btrfs_drew_lock_init\n"); if (ret) goto fail;And the souce come from:
Quoted 8 lines
commit
dcc3eb9638c3c927f1597075e851d0a16300a876Author: Nikolay Borisov <[email protected]> Date: Thu Jan 30 14:59:45 2020 +0200btrfs: convert snapshot/nocow exlcusion to drew lock
Any advice to fix this ENOMEM problem?
This is likely coming from changed behavior in MM, doesn't seem related to btrfs. We have multiple places where
nofs_save()is called. By the same token the failure might have occurred in any other place, in any other piece of code which usesmemalloc_nofs_save, there is no indication that this is directly related to btrfs.Quoted 5 lines
top command show that this server have engough memory.
The hardware of this server:
CPU: Xeon(R) CPU E5-2660 v2(10 core) *2 memory: 192G, no swapYou are showing that the server has 192G of installed memory, you have not shown any stats which prove at the time of failure what is the state of the MM subsystem. At the very least at the time of failure inspect the output of :
Quoted 6 lines
Quoted 5 lines
cat
/proc/meminfoand "free -m" commands.
<snip>
Only one xfstest job is running in this server.
Had what looks like the same issue happinging on a server:
[19146.391015] ------------[ cut here ]------------ [19146.391017] BTRFS: Transaction aborted (error -12) [19146.391035] WARNING: CPU: 13 PID: 1825871 at fs/btrfs/transaction.c:1684 create_pending_snapshot+0x912/0xd10 [19146.391036] Modules linked in: bcache crc64 loop dm_crypt bfq xfs dm_mod st sr_mod cdrom intel_powerclamp coretemp dcdbas kvm_intel snd_pcm snd_timer kvm snd irqbypass soundcore mgag200 serio_raw pcspkr drm_kms_helper evdev joydev iTCO_wdt iTCO_vendor_support i2c_algo_bit i7core_edac sg ipmi_si ipmi_devintf ipmi_msghandler wmi acpi_power_meter button ib_iser rdma_cm iw_cm ib_cm ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi drm configfs ip_tables x_tables autofs4 raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear md_mod sd_mod hid_generic usbhid hid crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel crypto_simd ahci cryptd glue_helper mpt3sas libahci uhci_hcd ehci_pci psmouse ehci_hcd lpc_ich raid_class libata nvme scsi_transport_sas mfd_core usbcore nvme_core scsi_mod t10_pi bnx2 [19146.391092] CPU: 13 PID: 1825871 Comm: btrfs Tainted: G W I?????? 5.10.26 #1 [19146.391093] Hardware name: Dell Inc. PowerEdge R510/0DPRKF, BIOS 1.14.0 05/30/2018 [19146.391095] RIP: 0010:create_pending_snapshot+0x912/0xd10 [19146.391097] Code: 48 0f ba aa 40 0a 00 00 02 72 28 83 f8 fb 74 48 83 f8 e2 74 43 89 c6 48 c7 c7 70 2d 10 82 48 89 85 78 ff ff ff e8 d5 65 55 00 <0f> 0b 48 8b 85 78 ff ff ff 89 c1 ba 94 06 00 00 48 c7 c6 70 46 e4 [19146.391098] RSP: 0018:ffffc900201c3b00 EFLAGS: 00010286 [19146.391099] RAX: 0000000000000000 RBX: ffff8881ba393200 RCX: ffff88880fb98b88 [19146.391100] RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff88880fb98b80 [19146.391101] RBP: ffffc900201c3bd0 R08: ffffffff825e2148 R09: 0000000000027ffb [19146.391101] R10: 00000000ffff8000 R11: 3fffffffffffffff R12: ffff888119dd39c0 [19146.391102] R13: ffff888248c36800 R14: ffff888a1bf69800 R15: 00000000fffffff4 [19146.391103] FS:? 00007f1d7c9488c0(0000) GS:ffff88880fb80000(0000) knlGS:0000000000000000 [19146.391104] CS:? 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [19146.391105] CR2: 00007fffef58d000 CR3: 000000028c988004 CR4: 00000000000206e0 [19146.391106] Call Trace: [19146.391111]? ? create_pending_snapshots+0xa2/0xc0 [19146.391112]? create_pending_snapshots+0xa2/0xc0 [19146.391114]? btrfs_commit_transaction+0x4b9/0xb40 [19146.391116]? ? start_transaction+0xd2/0x580 [19146.391119]? btrfs_mksubvol+0x29e/0x450 [19146.391122]? btrfs_mksnapshot+0x7b/0xb0 [19146.391124]? __btrfs_ioctl_snap_create+0x16f/0x180 [19146.391126]? btrfs_ioctl_snap_create_v2+0xb3/0x130 [19146.391128]? btrfs_ioctl+0x15f/0x3040 [19146.391131]? ? __x64_sys_ioctl+0x83/0xb0 [19146.391132]? __x64_sys_ioctl+0x83/0xb0 [19146.391136]? do_syscall_64+0x33/0x80 [19146.391140]? entry_SYSCALL_64_after_hwframe+0x44/0xa9 [19146.391142] RIP: 0033:0x7f1d7ca3fcc7 [19146.391144] Code: 00 00 00 48 8b 05 c9 91 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 99 91 0c 00 f7 d8 64 89 01 48 [19146.391145] RSP: 002b:00007fffef5919b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [19146.391146] RAX: ffffffffffffffda RBX: 00007fffef5a4c78 RCX: 00007f1d7ca3fcc7 [19146.391147] RDX: 00007fffef5919d0 RSI: 0000000050009417 RDI: 0000000000000004 [19146.391148] RBP: 0000565259b4d910 R08: ffffffffffffffff R09: 0000565259b4d9e0 [19146.391148] R10: 0000000000000000 R11: 0000000000000246 R12: 0000565259b4b8d0 [19146.391149] R13: 000000000000000e R14: 0000565259b4d9e0 R15: 00007fffef5919d0 [19146.391151] ---[ end trace 3d3ae6fb9d3c0b49 ]--- [19146.391153] BTRFS: error (device sdo2) in create_pending_snapshot:1684: errno=-12 Out of memory [19146.391187] BTRFS info (device sdo2): forced readonly [19146.391190] BTRFS warning (device sdo2): Skipping commit of aborted transaction. [19146.391191] BTRFS: error (device sdo2) in cleanup_transaction:1942: errno=-12 Out of memory [44395.445834] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519 [44395.448248] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519 [44395.448512] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519 [44395.455324] BTRFS error (device sdo2): parent transid verify failed on 280438898688 wanted 1423523 found 1423519