Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp776249ybh; Tue, 10 Mar 2020 08:04:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvyDwn0iUlo5D3jkTU4mNBAGbvmdpznK4ea+ROMks+0cqdeHU/rgTsyM/HmlI7/F3C//JpL X-Received: by 2002:a9d:5551:: with SMTP id h17mr17006889oti.360.1583852667435; Tue, 10 Mar 2020 08:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583852667; cv=none; d=google.com; s=arc-20160816; b=eW0fiRbLcynYa0mfzxjqb0cNk6kC/cn0Acr2N9sEohpGD/N54Eq0+p3eWsyDHdNqHn D5ahvFUtkZFS11cCkh8bo+X6DLaiylFzZ4N6vJpcDxTKMId7LzwlIYqrK+/EYcrDRcBW 6dRvNd8R3mPTvXDGVkqR1vQnKm+PqXCAQpa/ZdWnRZLoov6uA9MJrEJ+JxtAJ3p2dGzU VPTPTTuYeCwHoaE8mvXKDmxW9iOy1znTLlcjKX2DKoD2ZciV9XH7JDjsD5twZdFWFExx 3K7b5jpxeAK5nlvjmCd9Pz1Uz9B8yQ/lOj3KpdNBulfn247dKxF83T16Dc1fd19nrSVc O3Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=Feen9PWQJXnrtetun+BGBQDWZlOnNeskcbh9mD4M6uw=; b=oCVAPtLa9oPZso4xpVogqHG1B6/sJYeg0c0AESLk/KLMJ/z+WjCbYzN3IT5cLDzfWu JNUGkvjCF4iXkRryI6AGgb8YpiTxnQeOnxExWw1lm2GSlJZyaSexTVVRzYwxeLIPqv97 N6xyB4UkD9wx/ubVkS9gP7tCO3Qv5MGLXgoRFAiX58aZUvk2wkmxeaVzcOTTSkJp/Bqu 9NRB9g/0QX09SWm0H2yl89xzBwSrKufTru55p9OBj/yL5+t7c5r5CnTLQEH9XTMCubAH D5wTARgTMwziBO3INdldVhP/QUqGYjT8CQyTTLIDVdP/VKKma0W4is6oQ/H0eb8fMfau XIJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=coToy5GP; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r129si3079301oib.123.2020.03.10.08.03.20; Tue, 10 Mar 2020 08:04:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex-team.ru header.s=default header.b=coToy5GP; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726892AbgCJPCI (ORCPT + 99 others); Tue, 10 Mar 2020 11:02:08 -0400 Received: from forwardcorp1o.mail.yandex.net ([95.108.205.193]:45482 "EHLO forwardcorp1o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbgCJPCH (ORCPT ); Tue, 10 Mar 2020 11:02:07 -0400 Received: from mxbackcorp1g.mail.yandex.net (mxbackcorp1g.mail.yandex.net [IPv6:2a02:6b8:0:1402::301]) by forwardcorp1o.mail.yandex.net (Yandex) with ESMTP id 0CF862E1497; Tue, 10 Mar 2020 18:02:05 +0300 (MSK) Received: from myt5-70c90f7d6d7d.qloud-c.yandex.net (myt5-70c90f7d6d7d.qloud-c.yandex.net [2a02:6b8:c12:3e2c:0:640:70c9:f7d]) by mxbackcorp1g.mail.yandex.net (mxbackcorp/Yandex) with ESMTP id mFQyHLN6eK-23k46thl; Tue, 10 Mar 2020 18:02:04 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1583852524; bh=Feen9PWQJXnrtetun+BGBQDWZlOnNeskcbh9mD4M6uw=; h=Message-Id:Date:Subject:To:From:Cc; b=coToy5GPWCOkM7TTGEcaI6BCjU4MLyUTY0ODRZWr4vDx2IEZ3f0r4aM9OyWG0XEaK 2NkTvo1gLz0oDM2/zjtIXKgmYV1cPsncHNbYRTXcbeGObV47gSVv9Ms9Wj7g9Zor3f F0X2ckjSpbzopgbSg+sCG8lYZiRYkYP/ulMatELY= Authentication-Results: mxbackcorp1g.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from 95.108.174.193-red.dhcp.yndx.net (95.108.174.193-red.dhcp.yndx.net [95.108.174.193]) by myt5-70c90f7d6d7d.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id DnDE2BLoMZ-23V4BbiU; Tue, 10 Mar 2020 18:02:03 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Dmitry Monakhov To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, Dmitry Monakhov Subject: [PATCH] ext4: mark block bitmap corrupted when found instead of BUGON Date: Tue, 10 Mar 2020 15:01:56 +0000 Message-Id: <20200310150156.641-1-dmonakhov@gmail.com> X-Mailer: git-send-email 2.18.0 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org We already has similar code in ext4_mb_complex_scan_group(), but ext4_mb_simple_scan_group() still affected. Other reports: https://www.spinics.net/lists/linux-ext4/msg60231.html Signed-off-by: Dmitry Monakhov --- fs/ext4/mballoc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 1027e01..97cd1a2 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1901,8 +1901,15 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac, BUG_ON(buddy == NULL); k = mb_find_next_zero_bit(buddy, max, 0); - BUG_ON(k >= max); - + if (k >= max) { + ext4_grp_locked_error(ac->ac_sb, e4b->bd_group, 0, 0, + "%d free clusters of order %d. But found 0", + grp->bb_counters[i], i); + ext4_mark_group_bitmap_corrupted(ac->ac_sb, + e4b->bd_group, + EXT4_GROUP_INFO_BBITMAP_CORRUPT); + break; + } ac->ac_found++; ac->ac_b_ex.fe_len = 1 << i; -- 2.7.4