linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Ronan Arraes Jardim Chagas <ronisbr@gmail.com>,
	Chris Murphy <lists@colorremedies.com>
Cc: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: BTRFS constantly reports "No space left on device" even with a huge unallocated space
Date: Fri, 2 Sep 2016 10:09:18 -0400	[thread overview]
Message-ID: <93618edf-7a7b-b55c-4233-a845ad730941@suse.com> (raw)
In-Reply-To: <1472676550.8145.1.camel@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4493 bytes --]

On 8/31/16 4:49 PM, Ronan Arraes Jardim Chagas wrote:
> Hi guys!
> 
> And the problem happened again. This time, I was only using Mozilla
> Firefox. I could get the very first message after the error. I hope it
> brings more information:

Ok, so I think this is a race that can happen when one thread is
starting a transaction and another thread is committing a transaction
that involves creating a snapshot.

We reserve blocks at the top of start_transaction and that reservation
stays with the root.  In: btrfs_commit_transaction->
create_pending_snapshots-> create_pending_snapshot->
qgroup_account_snapshot-> commit_fs_roots, we clear that reservation
from the root via btrfs_qgroup_free_meta_all, potentially while
start_transaction is waiting to join a new transaction.  Or not.  It can
happen asynchronously, which is the point of having the reservation
prior to that.

So the thing is that this error can only occur if start_transaction
fails after this race occurs.  That, combined with your report that you
were seeing ENOSPC instead of EDQUOT, leads me to believe that this is
just a side effect of whatever is causing you to not hit ENOSPC.  I
expect that you'll see it again -- you just won't see the WARN_ON
anymore since quotas are disabled.  I suspect it's probably the
btrfs_block_rsv_add call immediately after the reservation, but there's
no way to tell without tracing.

-Jeff


> [28039.672199] ------------[ cut here ]------------
> [28039.672253] WARNING: CPU: 3 PID: 31800 at ../fs/btrfs/qgroup.c:2667
> btrfs_qgroup_free_meta+0x88/0x90 [btrfs]
> [28039.672255] Modules linked in: fuse nf_log_ipv6 xt_pkttype
> nf_log_ipv4 nf_log_common xt_LOG xt_limit af_packet iscsi_ibft
> iscsi_boot_sysfs msr ip6t_REJECT nf_reject_ipv6 xt_tcpudp
> nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw ipt_REJECT nf_reject_ipv4
> iptable_raw xt_CT nvidia_drm(PO) nvidia_modeset(PO) iptable_filter
> nvidia(PO) ip6table_mangle nf_conntrack_netbios_ns
> nf_conntrack_broadcast drm_kms_helper nf_conntrack_ipv4 drm
> nf_defrag_ipv4 fb_sys_fops snd_hda_codec_hdmi joydev
> snd_hda_codec_realtek ip_tables syscopyarea snd_hda_codec_generic
> xt_conntrack snd_hda_intel sysfillrect intel_rapl sb_edac edac_core
> snd_hda_codec hp_wmi x86_pkg_temp_thermal intel_powerclamp snd_hda_core
> snd_hwdep nf_conntrack sparse_keymap sysimgblt coretemp kvm_intel kvm
> rfkill irqbypass snd_pcm snd_timer crct10dif_pclmul
> [28039.672305]  e1000e crc32_pclmul ghash_clmulni_intel snd aesni_intel
> ip6table_filter aes_x86_64 lrw gf128mul glue_helper ablk_helper
> iTCO_wdt iTCO_vendor_support mei_wdt ioatdma pcspkr cryptd ip6_tables
> ptp lpc_ich fjes i2c_i801 dca mfd_core soundcore pps_core shpchp
> tpm_infineon tpm_tis tpm mei_me mei x_tables btrfs xor raid6_pq
> hid_generic usbhid crc32c_intel serio_raw xhci_pci ehci_pci sr_mod
> firewire_ohci xhci_hcd ehci_hcd cdrom firewire_core crc_itu_t isci
> usbcore usb_common libsas ata_generic mpt3sas raid_class
> scsi_transport_sas wmi button sg
> [28039.672373] CPU: 3 PID: 31800 Comm: gnome-terminal- Tainted:
> P        W  O    4.7.1-1-default #1
> [28039.672375] Hardware name: Hewlett-Packard HP Z820 Workstation/158B,
> BIOS J63 v03.65 12/19/2013
> [28039.672378]  0000000000000000 ffffffff81393104 0000000000000000
> 0000000000000000
> [28039.672382]  ffffffff8107ca1e ffff881008780800 0000000000014000
> ffff881008780800
> [28039.672386]  ffffffffffffffe4 ffff88100b297c00 ffff88053b7e3540
> ffffffffa02c9f58
> [28039.672390] Call Trace:
> [28039.672406]  [<ffffffff8102ed5e>] dump_trace+0x5e/0x320
> [28039.672413]  [<ffffffff8102f12c>] show_stack_log_lvl+0x10c/0x180
> [28039.672419]  [<ffffffff8102fe41>] show_stack+0x21/0x40
> [28039.672425]  [<ffffffff81393104>] dump_stack+0x5c/0x78
> [28039.672430]  [<ffffffff8107ca1e>] __warn+0xbe/0xe0
> [28039.672461]  [<ffffffffa02c9f58>] btrfs_qgroup_free_meta+0x88/0x90
> [btrfs]
> [28039.672492]  [<ffffffffa0261023>] start_transaction+0x3c3/0x4f0
> [btrfs]
> [28039.672521]  [<ffffffffa0271078>] btrfs_create+0x38/0x1d0 [btrfs]
> [28039.672528]  [<ffffffff8121e8fb>] path_openat+0x139b/0x14a0
> [28039.672535]  [<ffffffff8121fb2e>] do_filp_open+0x7e/0xe0
> [28039.672541]  [<ffffffff8120e7a4>] do_sys_open+0x124/0x1f0
> [28039.672547]  [<ffffffff816bb4f6>]
> entry_SYSCALL_64_fastpath+0x1e/0xa8
> [28039.676186] DWARF2 unwinder stuck at
> entry_SYSCALL_64_fastpath+0x1e/0xa8


-- 
Jeff Mahoney
SUSE Labs


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 881 bytes --]

  parent reply	other threads:[~2016-09-02 14:09 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 17:36 BTRFS constantly reports "No space left on device" even with a huge unallocated space Ronan Arraes Jardim Chagas
2016-08-12 18:02 ` Chris Murphy
2016-08-12 19:00   ` Ronan Arraes Jardim Chagas
2016-08-12 19:37     ` Chris Murphy
2016-08-12 20:34       ` Chris Murphy
     [not found]         ` <CAKdnfRJeOXHmrumDkfxLTf-nU=KwZ0f7ybET-3o7kwwJDOZ2aw@mail.gmail.com>
2016-08-15 23:24           ` Chris Murphy
2016-08-16 17:49             ` Ronan Arraes Jardim Chagas
2016-08-22 19:11             ` Ronan Arraes Jardim Chagas
2016-08-22 20:39             ` Ronan Arraes Jardim Chagas
2016-08-22 20:49               ` Chris Murphy
2016-08-22 21:04                 ` Ronan Arraes Jardim Chagas
2016-08-24  0:40                   ` Jeff Mahoney
2016-08-25 15:58             ` Lutz Vieweg
2016-08-25 23:56               ` Chris Murphy
2016-08-26  5:59                 ` Marc Haber
2016-08-29 12:12 ` Wang Xiaoguang
2016-08-29 13:20   ` Ronan Arraes Jardim Chagas
2016-08-29 15:52   ` Ronan Arraes Jardim Chagas
2016-08-29 22:25     ` Jeff Mahoney
2016-08-30  2:12     ` Wang Xiaoguang
2016-08-30 12:50       ` Ronan Arraes Jardim Chagas
2016-08-30 16:44         ` Chris Murphy
2016-08-30 16:57           ` Ronan Arraes Jardim Chagas
2016-08-31 20:49           ` Ronan Arraes Jardim Chagas
2016-08-31 21:44             ` Chris Murphy
2016-08-31 21:48               ` Chris Murphy
2016-08-31 22:47                 ` Jeff Mahoney
2016-08-31 22:58                   ` Chris Murphy
2016-08-31 23:03                     ` Jeff Mahoney
2016-08-31 23:09                       ` Chris Murphy
2016-09-01 12:57                         ` Ronan Arraes Jardim Chagas
2016-09-01 13:21                           ` Austin S. Hemmelgarn
2016-09-01 16:34                             ` Ronan Arraes Jardim Chagas
2016-09-01 17:04                               ` Austin S. Hemmelgarn
2016-09-01 17:12                                 ` Jeff Mahoney
2016-09-01 17:39                                   ` Ronan Arraes Jardim Chagas
2016-09-01 17:43                                     ` Jeff Mahoney
2016-09-01 17:58                                       ` Ronan Arraes Jardim Chagas
2016-09-01 17:45                                   ` Chris Murphy
2016-09-01 18:47                                   ` Austin S. Hemmelgarn
2016-09-02  0:12                                     ` Chris Murphy
2016-09-02 14:26                                       ` Jeff Mahoney
2016-09-02 14:43                                         ` Ronan Arraes Jardim Chagas
2016-09-02 14:48                                           ` Jeff Mahoney
2016-09-02 15:20                                             ` Ronan Arraes Jardim Chagas
2016-09-02 15:26                                               ` Jeff Mahoney
2016-09-02 19:25                                                 ` Ronan Arraes Jardim Chagas
2016-09-05  8:49                                                   ` Qu Wenruo
2016-09-08 18:24                                                     ` Ronan Arraes Jardim Chagas
2016-09-08 18:49                                                       ` Jeff Mahoney
2016-09-08 23:02                                                         ` Jeff Mahoney
2016-09-13 20:24                                                           ` Josef Bacik
2016-09-14 14:25                                                             ` Jeff Mahoney
2016-09-19  2:38                                                               ` Wang Xiaoguang
2016-09-22 13:40                                                                 ` Jeff Mahoney
     [not found]                                                               ` <57DF4E44.2040506@cn.fujitsu.com>
2016-09-22 13:20                                                                 ` Ronan Arraes Jardim Chagas
2016-09-22 13:41                                                                   ` Austin S. Hemmelgarn
2016-09-22 14:03                                                                     ` Ronan Arraes Jardim Chagas
2016-09-22 14:39                                                                       ` Josef Bacik
2016-09-22 17:06                                                                         ` Ronan Arraes Jardim Chagas
2016-09-22 17:49                                                                           ` Josef Bacik
2016-09-22 17:54                                                                             ` Ronan Arraes Jardim Chagas
2016-09-23 15:20                                                                             ` [SOLVED] " Ronan Arraes Jardim Chagas
2016-09-02 19:56                                                 ` Ronan Arraes Jardim Chagas
2016-09-02 21:34                                                   ` Chris Murphy
2016-09-02 22:13                                                     ` Ronan Arraes Jardim Chagas
2016-09-02 22:39                                                       ` Chris Murphy
2016-09-03  2:47                                                         ` Ronan Arraes Jardim Chagas
2016-09-03  3:41                                                           ` Chris Murphy
2016-09-03  3:47                                                             ` Ronan Arraes Jardim Chagas
2016-09-03  4:14                                                               ` Chris Murphy
2016-09-01 17:07                             ` Chris Murphy
2016-09-02  0:37               ` Qu Wenruo
2016-09-02 14:09             ` Jeff Mahoney [this message]
2016-09-14 20:15   ` Ronan Arraes Jardim Chagas
2016-09-14 22:25     ` Chris Murphy
2016-09-15  0:56       ` Ronan Arraes Jardim Chagas
2016-09-13  3:17 ` Wang Xiaoguang
2016-09-13 12:54   ` Ronan Arraes Jardim Chagas
2016-09-13 20:49   ` Ronan Arraes Jardim Chagas
2016-09-13 21:01     ` Josef Bacik
2016-09-14 14:40       ` Ronan Arraes Jardim Chagas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93618edf-7a7b-b55c-4233-a845ad730941@suse.com \
    --to=jeffm@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=ronisbr@gmail.com \
    --cc=wangxg.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).