[Bugme-new] [Bug 16508] New: BTRFS ENOSPC at 39% use and resulting kernel warnings filling dmesg

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Tue Aug 3 19:20:51 PDT 2010


https://bugzilla.kernel.org/show_bug.cgi?id=16508

           Summary: BTRFS ENOSPC at 39% use and resulting kernel warnings
                    filling dmesg
           Product: File System
           Version: 2.5
    Kernel Version: Vanilla 2.6.35
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: btrfs
        AssignedTo: fs_btrfs at kernel-bugs.osdl.org
        ReportedBy: kernel-bugs.dev1world at spamgourmet.com
        Regression: No


Steps to reproduce:

1. Boot into 2.6.35 vanilla kernel.
2. Create an loopback btrfs with 4GB disk file.

time dd if=/dev/zero of=btrfs-fs.img count=8000 bs=512k oflag=direct
mkfs.btrfs btrfs-fs.img 
mount -o loop,noatime btrfs-fs.img /mnt/floppy

3. Create a large file in it
cd /mnt/floppy
time dd if=/dev/zero of=tempfile count=7000 bs=512k oflag=direct 

4. Copy a large number of files in it.

cd /mnt/floppy
time cp -a /usr/portage/[a-z]* .
cp: writing `./local/ccache/x64/9/3/591f3f514cd2144eb42e3498afd146-3170951': No
space left on device
cp: writing `./local/ccache/x64/9/3/d0ad1d270e933bcf1874a61dfa476d-3505981': No
space left on device
...

5. See usage

# df .
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/loop0             4096000   3880592    215408  95% /mnt/floppy

# btrfs filesystem df .
Data: total=3.49GB, used=3.48GB
Metadata: total=208.00MB, used=112.05MB
System: total=12.00MB, used=4.00KB

# find .|wc -l
59739

Total is 3.49GB instead of 4GB. It failed before it could hit 3.49GB anyway. If
you take 1KB=1024 into account and add up metadata total, about 220MB space is
still missing.
Anyway, let's try to break this very fragile FS.

6. Remove the large 3.5GB file

# \rm tempfile 

7. Copy small files again.

# time cp -a /usr/portage/local/ .
cp: writing `./local/ccache/x32/5/9/1c179b03251ae69c511aa5f50a988a-282393': No
space left on device
cp: cannot create regular file
`./local/ccache/x32/5/9/75785af807da1c7dabc90d4643c43b-144796': No space left
on device
cp: cannot create regular file
`./local/ccache/x32/5/9/30bd5db7b5a0fa5cefe6514fda23d5-1642583': No space left
on device
...

8. See usage

# df .
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/loop0             4096000   1568312   2527688  39% /mnt/floppy

# btrfs filesystem df .
Data: total=3.49GB, used=1.12GB
Metadata: total=208.00MB, used=191.92MB
System: total=12.00MB, used=4.00KB

# df -i .
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/loop0                 0       0       0    -  /mnt/floppy

# cp /usr/lib/libc.a .
cp: cannot create regular file `./libc.a': No space left on device

# find .|wc -l
132860

9. Remove files at this time

# \rm -rf dev-cpp

This hangs, soaking up 2 full CPUs. Had to ctrl-C out of it. Fills up (very
large) dmesg buffer with:

[43545.427000] ------------[ cut here ]------------
[43545.427000] WARNING: at fs/btrfs/extent-tree.c:3441
btrfs_block_rsv_check+0x10c/0x13f()
[43545.427000] Hardware name: OEM
[43545.427000] Modules linked in: f71882fg pvrusb2 dvb_core cx2341x tveeprom
vboxnetadp vboxnetflt vboxdrv snd_seq_oss snd_seq_midi_event snd_seq
snd_seq_device snd_pcm_oss snd_mixer_oss tuner_simple tuner_types uvcvideo
usb_storage usblp ohci_hcd tun snd_intel8x0 snd_ac97_codec ac97_bus acp
i_cpufreq mperf cifs fuse coretemp tda9887 tda8290 wm8775 tuner cx25840
v4l2_common videodev v4l1_compat v4l2_compat_ioctl32 snd_hda_codec_realtek
 snd_hda_intel snd_hda_codec snd_pcm ohci1394 nvidia(P) snd_timer i2c_i801
ieee1394 r8169 pcspkr snd snd_page_alloc pata_jmicron ehci_hcd uhci_hcd
 evdev [last unloaded: f71882fg]
[43545.427000] Pid: 19024, comm: rm Tainted: P        W   2.6.35 #1
[43545.427000] Call Trace:
[43545.427000]  [<ffffffff81034994>] ? warn_slowpath_common+0x78/0x8c
[43545.427000]  [<ffffffff8116836e>] ? btrfs_block_rsv_check+0x10c/0x13f
[43545.427000]  [<ffffffff81176ae7>] ? __btrfs_end_transaction+0x9f/0x1a8
[43545.427000]  [<ffffffff8117c8b7>] ? btrfs_delete_inode+0x169/0x184
[43545.427000]  [<ffffffff810ac7e3>] ? generic_delete_inode+0x86/0x104
[43545.427000]  [<ffffffff810a513f>] ? do_unlinkat+0xe6/0x13e
[43545.427000]  [<ffffffff810a74cd>] ? vfs_readdir+0x86/0x9c
[43545.427000]  [<ffffffff81099f78>] ? filp_close+0x5f/0x6a
[43545.427000]  [<ffffffff81001f2b>] ? system_call_fastpath+0x16/0x1b
[43545.427000] ---[ end trace be14a72aca4c094f ]---
[43545.427000] block_rsv size 33554432 reserved 8613888 freed 0 0
[43545.428000] ------------[ cut here ]------------ 

It does not delete any files. Still can't create a small file.

# df -i .
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/loop0                 0       0       0    -  /mnt/floppy

# cp /usr/lib/libc.a .
cp: cannot create regular file `./libc.a': No space left on device

I have a lzma compressed image file if you want it but its so darn fragile and
repeatable, you wouldn't need that. I have no idea how and why it was not even
tested for basic stress like this one.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Bugme-new mailing list