Rene Thomas | 24 Oct 18:43 2014
Picon
Picon

read block failed check_tree_block / Couldn't read chunk tree

Dear Developers / Maintainer,
I’ve set up a running RAID5 with three devices (sda1 / sdb1 /sdc1)

Mountpoint was /home, filesystem was mounted
A chain of unfortunal circumstances gives me the chance to run as root
in a terminal.

mkfs.ntfs /dev/sdb1

where /dev/sdb1 is device 1 in the Array.

After a while I’ve realised that the terminal I used was the wrong one
and killed the process where the progress still was 0%.
The filesystem was still in a readable state switched to read only.
Write access was not able.

After a restart the RAID failed to mount.

Tried several steps to reactivate the Array.

All btrfs commands leads to:

Check tree block failed, want=5845480062976, have=0
Check tree block failed, want=5845480062976, have=0
Check tree block failed, want=5845480062976, have=65536
Check tree block failed, want=5845480062976, have=0
Check tree block failed, want=5845480062976, have=0
read block failed check_tree_block
Couldn't read chunk tree

(Continue reading)

Jasper Verberk | 24 Oct 15:32 2014
Picon

Problem converting data raid0 to raid1: enospc errors during balance

Hello,

I'm trying to change my 4 disk btrfs data from raid0 to raid1. The metadata is allready in raid1 and now I'm
trying to also make the data raid1.

I'm getting the following errors and I got told on irc to go report this as a bug.

Hoping there is anybody that can give me a hand here in solving it.

-------------------------------
Command I issued was:

  btrfs balance start -dconvert=raid1,soft /data
-------------------------------

-------------------------------
Error I got:

  ERROR: error during balancing '/data' - No space left on device
  There may be more info in syslog - try dmesg | tail
-------------------------------

-------------------------------
Last lines of dmesg:

[60098.584459] BTRFS info (device sdc): relocating block group 18282971136 flags 9
[60102.422310] BTRFS info (device sdc): relocating block group 5398069248 flags 9
[60102.776406] BTRFS info (device sdc): relocating block group 1103101952 flags 9
[60103.168554] BTRFS info (device sdc): relocating block group 4194304 flags 4
[60103.619552] BTRFS info (device sdc): relocating block group 0 flags 2
(Continue reading)

Zygo Blaxell | 24 Oct 01:16 2014

Check tree block failed, want=17716610236416, have=0

I attempted to run btrfs check --repair, but it got stuck spinning
in what appeared to be an infinite loop.  strace and ltrace revealed
nothing, and gdb wasn't particularly helpful, so I rebuilt btrfs with
debug symbols and tried again.

Now I get this from btrfs check:

	Couldn't map the block 17716610236416
	No mapping for 17716610236416-17716610252800
	Couldn't map the block 17716610236416
	Check tree block failed, want=17716610236416, have=0
	read block failed check_tree_block
	Couldn't read chunk root

Mount fails too:

	Oct 23 18:19:38 testhost kernel: [  388.193783] BTRFS: device label vgs2-md0 devid 3 transid 282186 /dev/dm-11
	Oct 23 18:19:38 testhost kernel: [  388.232892] BTRFS: device label vgs2-md0 devid 1 transid 282186 /dev/mapper/md15
	Oct 23 18:19:38 testhost kernel: [  388.233305] BTRFS: device label vgs2-md0 devid 2 transid 282186 /dev/mapper/md16
	Oct 23 18:19:38 testhost kernel: [  388.234459] BTRFS: device label vgs2-md0 devid 4 transid 282186 /dev/mapper/md18
	Oct 23 18:19:38 testhost kernel: [  388.759456] BTRFS info (device dm-12): disk space caching is enabled
	Oct 23 18:19:38 testhost kernel: [  388.759462] BTRFS: has skinny extents
	Oct 23 18:19:38 testhost kernel: [  388.760576] BTRFS critical (device dm-12): unable to find logical
17716610236416 len 4096
	Oct 23 18:19:38 testhost kernel: [  388.760733] ------------[ cut here ]------------
	Oct 23 18:19:38 testhost kernel: [  388.760807] kernel BUG at fs/btrfs/inode.c:1659!
	Oct 23 18:19:38 testhost kernel: [  388.760880] invalid opcode: 0000 [#1] PREEMPT SMP
	Oct 23 18:19:38 testhost kernel: [  388.761063] Modules linked in: tun cpufreq_userspace cpufreq_stats
cpufreq_powersave cpufreq_conservative softdog nfsd auth_rpcgss nfs_acl nfs lockd fscache sunrpc
dummy ipt_MASQUERADE xt_nat xt_tcpudp xt_state iptable_mangle nf_log_ipv4 nf_log_common xt_LOG
(Continue reading)

Larkin Lowrey | 24 Oct 01:04 2014

Heavy nocow'd VM image fragmentation

I have a 240GB VirtualBox vdi image that is showing heavy fragmentation
(filefrag). The file was created in a dir that was chattr +C'd, the file
was created via fallocate and the contents of the orignal image were
copied into the file via dd. I verified that the image was +C.

After initial creation there were about 2800 fragments, according to
filefrag. That doesn't surprise me because this image took up about 60%
of the free space. After an hour of light use the filefrag count was the
same. But, after a day of heavy use, the count is now well over 600,000.

There were no snapshots during the period of use. The fs does not have
compression enabled. These usual suspects don't apply in my case.

The process I used to copy the image to a noCOW image was:

fallocate -n -l $(stat --format %s old.vdi) new.vdi
dd if=old.vdi of=new.vdi conv=notrunc oflags=append bs=1M

Performance does seem much worse in the VM but could it be that the
image isn't actually severely fragmented and I'm just misunderstanding
the output from filefrag?

Is there a problem with how I copied over the old image file?

--Larkin

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
(Continue reading)

Robert White | 24 Oct 00:27 2014
Picon

Mounting(multiply)? Options(stored)? Options(barriers)?

I've got several questions about mount features that I've been unable to 
find definitive answers for.

ITEM: So there are some mount options that I'd like to be able to pin 
onto a media like compress=lzo on a thumb drive I expect to get crowded. 
Is there a feature equivalent to the -o option to tune2fs either present 
or planned?

ITEM: Is there a means (or a plan for a means) to use a subvol as a 
means to prevent/change active features from propigating to a 
subdirectory? An example would be a means to turn off autodefrag or 
compression for a subvolume full of virtual machine images, whilest 
having it active for the bulk of the filesystem.

ITEM: If I make one file system and have subvols /__System /home and 
/VMs and mount those as / /home and /usr/local/VMs respectively, with 
differing feature options for each, will those options be separately 
honored or will the last-mounted or first-mounted subvolume's options 
take dominant effect? Compression, auto-defragment, and commit interval 
being of primary concern.

ITEM: Is there a no-compress attribute (or something similar) for 
negating compress= mount options on specific files or directories? How 
about a no-autodefrag?

(I'm about to set up a system and some standards that may last many 
years and I'm trying to find the reasonable bounds of where I need to do 
hard partitioning.)

--Rob.
(Continue reading)

Robert White | 23 Oct 20:36 2014
Picon

Promote Snapshot to Subvolume? (again)

I'll ask again...

Is there any reason it would be Bad™ to allow a snapshot subvolume to be 
"promoted" to a non-snapshot subvolume?

I know that there is precious little difference between the two. But 
there _is_ a difference once you start trying to automate system 
maintenance.

What I want is a "btrfs property set /path snapshot false" that would 
change the subvolume root such that it looked like it had been made with 
"btrfs subvol create" instead of "btrfs subvol snapshot".

LONG BORING JUSTIFICATION:

One of my actual systems:

Gust ~ # btrfs sub list /
ID 256 gen 571944 top level 5 path home
ID 574 gen 571944 top level 5 path var/tmp
ID 962 gen 262649 top level 5 path BACKUP-2014-06-18
ID 963 gen 262648 top level 256 path home_BACKUP-2014-06-18
ID 964 gen 330331 top level 5 path BACKUP-2014-07-15
ID 965 gen 330331 top level 256 path home_BACKUP-2014-07-15
ID 970 gen 443923 top level 5 path BACKUP-2014-09-01
ID 971 gen 443924 top level 256 path home_BACKUP-2014-09-01

Gust ~ # btrfs sub list -s /
ID 962 gen 262649 cgen 262642 top level 5 otime 2014-06-18 02:25:33 path 
BACKUP-2014-06-18
(Continue reading)

Roman Mamedov | 23 Oct 16:24 2014
Picon

"Transaction commit" in btrfs sub del

Hello,

I was under impression that the "Transaction commit:" setting in 'btrfs sub
del' finally allows us to make it not return until all free space from the
snapshots that are being deleted, is completely freed up.

However that does not seem to be the case at all, deleting 14 snapshots with a
heavy write-load occuring at the same time (Btrfs v3.14.1, kernel 3.14.22),
with "Transaction commit: at the end", the 'btrfs' utility exited, and I still
observe no change in free space numbers. It got finally freed only a couple of
minutes later, i.e. as it usually would, without any commit options.

So what is the purpose of these options, if they do not seem to have an effect?

--

-- 
With respect,
Roman
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Anand Jain | 23 Oct 15:12 2014
Picon

Re: [PATCH 1/5] btrfs-progs: scan /proc/partitions not all of /dev with "-d"


  my stap func profiling script was wrong, I got the number of
  times scan_lblkid func called per thread wrong, now its
  been corrected as below. yet calling the system-wide device
  scan more than once per thread does not make any sense. There
  are quite a number of threads like that as below. The worst is
  mkfs.btrfs which calls n number of times, where n is number of
  disk being mkfs-ed.

   btrfs-find-root            1
   btrfs rescue super-recover 2
   btrfs-debug-tree           1
   btrfs-image -r             2
   btrfs check                2
   btrfs restore              2
   calc-size                  NC
   btrfs-corrupt-block        NC
   btrfs-image                NC
   btrfs-map-logical          1
   btrfs-select-super         NC
   btrfstune                  2
   btrfs-zero-log             NC
   tester                     NC
   quick-test.c               NC
   btrfs-convert              0
   mkfs                       #number of devices to be mkfs
   btrfs label set unmounted  2
   btrfs get label unmounted  2

On 10/06/14 17:31, Anand Jain wrote:
(Continue reading)

Qu Wenruo | 23 Oct 04:37 2014

[PATCH] btrfs: Enhance btrfs chunk allocation algorithm to reduce ENOSPC caused by unbalanced data/metadata allocation.

When btrfs allocate a chunk, it will try to alloc up to 1G for data and
256M for metadata, or 10% of all the writeable space if there is enough
space for the stripe on device.

However, when we run out of space, this allocation may cause unbalanced
chunk allocation.
For example, there are only 1G unallocated space, and request for
allocate DATA chunk is sent, and all the space will be allocated as data
chunk, making later metadata chunk alloc request unable to handle, which
will cause ENOSPC.
This is the one of the common complains from end users about why ENOSPC
happens but there is still available space.

This patch will try not to alloc chunk which is more than half of the
unallocated space, making the last space more balanced at a small cost
of more fragmented chunk at the last 1G.

Some easy example:
Preallocate 17.5G on a 20G empty btrfs fs:
[Before]
 # btrfs fi show /mnt/test
Label: none  uuid: da8741b1-5d47-4245-9e94-bfccea34e91e
	Total devices 1 FS bytes used 17.50GiB
	devid    1 size 20.00GiB used 20.00GiB path /dev/sdb
All space is allocated. No space later metadata space.

[After]
 # btrfs fi show /mnt/test
Label: none  uuid: e6935aeb-a232-4140-84f9-80aab1f23d56
	Total devices 1 FS bytes used 17.50GiB
(Continue reading)

Gui Hecheng | 23 Oct 03:56 2014

[PATCH] btrfs-progs: fix dev stats error output related to replace handle

Steps to reproduce:
	# mkfs.btrfs -f /dev/sdb7
	# mount /dev/sdb7 /mnt
	# btrfs dev stats /dev/sdb7
output:
	[/dev/sdb7].write_io_errs   0
	[/dev/sdb7].read_io_errs    0
	[/dev/sdb7].flush_io_errs   0
	[/dev/sdb7].corruption_errs 0
	[/dev/sdb7].generation_errs 0
	* ERROR: ioctl(BTRFS_IOC_GET_DEV_STATS) on  failed: No such device

while the following cmd:
	# btrfs dev stats /mnt
yields the right thing:
	[/dev/sdb7].write_io_errs   0
	[/dev/sdb7].read_io_errs    0
	[/dev/sdb7].flush_io_errs   0
	[/dev/sdb7].corruption_errs 0
	[/dev/sdb7].generation_errs 0

This is caused by commit:
	commit d0588bfa479409b2a0f6243f894338a01a56221a
	btrfs-progs: do a separate probe for transient replacing device

The above commit trys to handle the fi show problem with device under
replacing, but it changes the  <at> get_fs_info() logic which annoys dev stats.
For  <at> get_fs_info():
o If the passed in  <at> path is a mount point, then the  <at> get_device_info() to
  probe the replacing device will be glad to accept the device index
(Continue reading)

Robert White | 22 Oct 22:08 2014
Picon

NOCOW and Swap Files?

So the documentation is clear that you can't mount a swap file through 
BTRFS (unless you use a loop device).

Why isn't a NOCOW file that has been fully pre-allocated -- as with 
fallocate(1) -- not suitable for swapping?

I found one reference to an unimplemented feature necessary for swap, 
but wouldn't it be reasonable for that feature to exist for NOCOW files? 
(or does this relate to my previous questions about the COW operation 
that happens after a snapshot?)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane