Skip to contentSkip to conversation

btrfs filesystem defrag fails with "Resource temporarily unavailable" when strace'd

DISCUSSION Lutz Vieweg 1 participant 1 message Jun 26, 2015 Btrfs file system

lore
Share & tools
lore
#0 lore raw

I started...
btrfs filesystem defragment -v /some/directory
and this took (unexpectedly, for just 150M of data) a long time (minutes).

So I wondered whether I could see via "strace -p PID" what was going on with the process.

Immediately when strace tries to attach, the btrfs process dies with this error message:

Quoted 1 line

ERROR: defrag failed on /some/directory - Resource temporarily unavailable

This is 100% reproducable.

The strace output looks like this:

Quoted 11 lines

Process 1402 attached

brk(0)                                  = 0x1468000
brk(0)                                  = 0x1468000
brk(0x1460000)                          = 0x1460000
brk(0)                                  = 0x1460000
close(3)                                = 0
write(2, "ERROR: defrag failed on /some/d"..., 84) = 84
write(1, "btrfs-progs v4.1\n", 17)      = 17
write(2, "total 1 failures\n", 17)      = 17
exit_group(1)                           = ?

+++ exited with 1 +++

This is the first time I see a prozess crash upon strace being attached - is this intended behaviour? If so... why?

(Tried again without strace, "the btrfs filesystem defragment" command later finished ok, albeight after a loong time.)

Regards,

Lutz Vieweg