From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-ch2-02v.sys.comcast.net ([69.252.207.34]:47422 "EHLO resqmta-ch2-02v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbaL0OTU (ORCPT ); Sat, 27 Dec 2014 09:19:20 -0500 Message-ID: <549EBFE6.1020304@pobox.com> Date: Sat, 27 Dec 2014 06:19:18 -0800 From: Robert White MIME-Version: 1.0 To: Martin Steigerwald CC: Hugo Mills , linux-btrfs@vger.kernel.org Subject: Re: BTRFS free space handling still needs more work: Hangs again References: <3738341.y7uRQFcLJH@merkaba> <3538352.CI4nobbHtu@merkaba> <549E9D98.7010102@pobox.com> <9534911.qSQhRgc3Jg@merkaba> <549EBB90.5070406@pobox.com> In-Reply-To: <549EBB90.5070406@pobox.com> Content-Type: text/plain; charset=windows-1252; format=flowed Sender: linux-btrfs-owner@vger.kernel.org List-ID: On 12/27/2014 06:00 AM, Robert White wrote: > On 12/27/2014 05:16 AM, Martin Steigerwald wrote: >> It can easily be reproduced without even using Virtualbox, just by a nice >> simple fio job. >> > > TL;DR: If you want a worst-case example of consuming a BTRFS filesystem > with one single file... > > #!/bin/bash > # not tested, so correct any syntax errors > typeset -i counter > for ((counter=250;counter>0;counter--)); do > dd if=/dev/urandom of=/some/file bs=4k count=$counter > done > exit 0 Slight correction: you need to prevent the truncate dd performs by default, and flush the data and metadata to disk between after each invocatoin. So you need the "conv=" flags. for ((counter=250;counter>0;counter--)); do dd if=/dev/urandom of=some_file conv=notrunc,fsync bs=4k count=$counter done > > > Each pass over /some/file is 4k shorter than the previous one, but none > of the extents can be deallocated. File will be 1MiB in size and usage > will be something like 125.5MiB (if I've done the math correctly). > larger values of counter will result in exponentially larger amounts of > waste. > > Doing the bad things is very bad... > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >