Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp672500ybi; Fri, 2 Aug 2019 02:21:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWhR+vC2u2CFzLp7+2avBBqnC1hrzTge0C+rZykfHwU5Lj+eh9GD5sEhrO5G4X44qjWebZ X-Received: by 2002:a17:902:f095:: with SMTP id go21mr132817184plb.58.1564737715435; Fri, 02 Aug 2019 02:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564737715; cv=none; d=google.com; s=arc-20160816; b=aB67yPJwxT9nobc7y+xaOxNUIk07qRtS/c6Mc7JxJj7t0rgCRYoAGJaM4Pa7BL8HZ1 h4WYMspzJYf0BLBrva0szjKSka92PDXR/cyTnGyZfc2k3AABdLUIgr3iWJtHZLYLG55V MnNxjq5+IBkjcdnRTy6GD9XdjDwAkVPkfUh0OtgzFstmmGLuUWL6FlGeBfX3DoPzHmXV vt/8nJyBKFyHAEg1iJlDSW0XXGjrONPgEe0HoQj9haBRNCSpO/oLxe/TdYY2E53l0gUT DAz8YVC0Y8HHCl+Ppu0rWc91sPmQawsPwISULmPBoOpt0RSD9I+/y538Et/uZS/Zh5PW eWiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=rYi3jUsDpMkcu+VUOi3u/ti7qjlZde/KlTAacVwd/Mk=; b=tdUEe4+KoPhVmmFH2z1SS8wdBZ7nOlD3EIS4YMxmnCtam9QnnknPzmcAmTGuljXw5i +3dissKd9vPr+gHfPs3DWdUQ74yMkKJ+VUGvIf+lTpf3HhTczCznZIxK/Lol5PV59j/G KecH1aA4tTTc/7zCykcdbF6xdWBxchU7fgR7WIznP8Rqqwye8ovk5AMyTXc0gnze2jbb KJKEalavdSf0VAKbktGanJiYwTRoVwSMHUa/MjvJ6OjKRa7XbnYHUQFiR/o+l2qgX9WC XzjokGoLhvQxVSPePzLdqHrwveNMaoiHIII+Oq76jblrvEkhgWZVHqYNA0KQSnF5O/2Y WuoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si33858051pls.42.2019.08.02.02.21.40; Fri, 02 Aug 2019 02:21:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389287AbfHBHDr (ORCPT + 99 others); Fri, 2 Aug 2019 03:03:47 -0400 Received: from mail1.windriver.com ([147.11.146.13]:55752 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732058AbfHBHDr (ORCPT ); Fri, 2 Aug 2019 03:03:47 -0400 Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id x723BsMQ006917 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 1 Aug 2019 20:11:54 -0700 (PDT) Received: from [128.224.162.188] (128.224.162.188) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.468.0; Thu, 1 Aug 2019 20:11:53 -0700 Subject: Re: Bug Report: Btrfs prompts "can't allocate space for delete" when block size arounds 512M From: "Hongzhi, Song" To: , , CC: , References: Message-ID: Date: Fri, 2 Aug 2019 11:11:50 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [128.224.162.188] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add linux-kernel@vger.kernel.org. Ping... Thanks, --Hongzhi On 7/17/19 4:34 PM, Hongzhi, Song wrote: > Hi friends, > > *Description:* > > >     One LTP testcase, fs_fill.c, fails on btrfs with kernel error when > unlink files on Btrfs device: > >     "BTRFS warning (device loop0): could not allocate space for a > delete; will truncate on mount". > > >     I found the loop block device formatted with btrfs roughly rangs > from 460M to 560M will cause the error. > >     256M and 1G all pass. > > >     The fs_fill.c source code: > > [https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/fs/fs_fill/fs_fill.c] > > >     The fs_fill.c calls unlink which triggers the error. > > [https://github.com/linux-test-project/ltp/blob/e3457e42c1b93f54bb81da746eba314fd34ad40e/testcases/kernel/fs/fs_fill/fs_fill.c#L55] > > > [https://github.com/linux-test-project/ltp/blob/e3457e42c1b93f54bb81da746eba314fd34ad40e/lib/safe_macros.c#L358] > > > > *Error info:* > >     The issue maybe not reproduced everytime but four fifths chance. > >     fs_fill.c:53: INFO: Unlinking mntpoint/thread5/file0 >     safe_macros.c:360: BROK: fs_fill.c:55: > unlink(mntpoint/thread10/file0) failed: ENOSPC >     safe_macros.c:360: BROK: fs_fill.c:55: > unlink(mntpoint/thread11/file0) failed: ENOSPC >     [62477.378848] BTRFS warning (device loop0): could not allocate > space for a delete; will truncate on mount >     [62477.378905] BTRFS warning (device loop0): could not allocate > space for a delete; will truncate on mount > > > > *Kernel:* > >     After v5.2-rc1, qemux86-64 > >     # make -j40 ARCH=x86_64 CROSS_COMPILE=x86-64-gcc >     use qemu to bootup kernel > > > *LTP:* > >     master branch: I tested on 20190625 >     Reproduce: > >     // build Ltp >     # cd Ltp-source >     # ./build.sh > >     // copy files to qemu >     # cp runltp testcases/kernel/fs/fs_fill/fs_fill to qemu > >     // login to qemu: >     // adjust block device size to 512M >     # vi runltp >     in function: create_block() >         dd if=/dev/zero of=${TMP}/test.img bs=1024 count=262144 >         ---> >         dd if=/dev/zero of=${TMP}/test.img bs=1024 count=524288 > >     // execute testcase >     # runltp -f fs -s fs_fill > > > *Analysis:* > >     One new kernel commit contained in v5.2-rc1 introduces the issue. > >     commit c8eaeac7b734347c3afba7008b7af62f37b9c140 >     Author: Josef Bacik >     Date:   Wed Apr 10 15:56:10 2019 -0400 > >         btrfs: reserve delalloc metadata differently >         ... > > > Anyone's reply will be appreciated. > > --Hongzhi > > > > >