Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1826123rwl; Thu, 30 Mar 2023 01:57:04 -0700 (PDT) X-Google-Smtp-Source: AKy350ZiO23H0lcn331ycnNzfgB11bCvx5julApUY1OVzcH/LSIq0cOraF/mjAFuWxFtUj5s0QXf X-Received: by 2002:a17:902:c94d:b0:1a2:74bc:31d8 with SMTP id i13-20020a170902c94d00b001a274bc31d8mr4432861pla.4.1680166624360; Thu, 30 Mar 2023 01:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680166624; cv=none; d=google.com; s=arc-20160816; b=AT4cajzRFrZSZpspkiOni9BYn7Odv9ng/091yr3xa2Nc/h3Gg/AmP6VSy/mpXL3c1H F7RWVCawCAglHYnA+Z40WDvSxm0qow0uTc2KiL0ydRd3KasRonw7e4mQG+iUMyv0KWm8 5PAgEJugSOZpP1Dxl53gPs5xcslaSJ9IYxjuB0xHAPvFb7+245SFI8o7euNWvpEJLw2H QnDik8PDInX8jf9b869CaN4hfQfq69hkK4RU+SKXgBUBLWkWoYFmMQEnV8HUYigjMAqE 3mbJL7XEJCwiHy8Tr/zZ90qqTH6IHvy+gF8QsGAybfzK8W2lD6r2mlAtCCwCPlHG6Jl8 zc3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/pUGbSJeXIbqbiydf5b6Zg3qCqAFB/oHTtk54OkF+CA=; b=v9VdzAkkorTth/uhJVR0Io4hrfhB4R1g2y72WEq8TiewzRaLlbyfk6/joU0oC8b5Ts VgtE6Oi9S7vgOsmS31sKqpoWLt+ZGlUfd/UO8gemmscSCnPtBDTCX+ZVbpXEzaO9sKA2 I2xYQ9eDNIclQ+3qa7vc/HJezNBkbznSixPiCj9BZRfxNe3aukkA0F4RxVp4Vw5nNjiS oiduX0MmPSqQtlFzSON3nxsXpnSPml1+g+g4r+ZXgcVj1jL3GBJ0FXbkFoFn4SH17HOc GNU2UEK44YQx1AA+nM8D7xlzWtxHWqHngFT7Xhf9DPei4wz1od1KP7znUrmxnmexg9fZ TCOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UL5A7+vS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n21-20020a170903405500b001a1cbc3bce8si26065725pla.429.2023.03.30.01.56.51; Thu, 30 Mar 2023 01:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UL5A7+vS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbjC3IxG (ORCPT + 99 others); Thu, 30 Mar 2023 04:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjC3Iww (ORCPT ); Thu, 30 Mar 2023 04:52:52 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8482D3AA5 for ; Thu, 30 Mar 2023 01:52:50 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-3e0965f70ecso464521cf.0 for ; Thu, 30 Mar 2023 01:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680166369; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/pUGbSJeXIbqbiydf5b6Zg3qCqAFB/oHTtk54OkF+CA=; b=UL5A7+vSaNkedjf0RM940TocfhoumuI7tBaS0YWz+AHdmXrZAsaX8wgg+j5w7RF298 Ekgfde63pCUQs435mfNAHjovy4bNbY4sepG9CY+NHWzSERKuHVeenfS0xlvcOAc3APQ7 vbdswldNEjf9OgMR1peH6SZRFXCyErykMe0XvFX5aBgj1YS2y9b3ZrM8ZBkPRXLIvapG gT+rAgFbSqezQkJTs8u5i/mu+uOUu17Ry9YM25/tirUXp0lFmsR4PwhRjtPvvznbAmC5 H0OTEqHc5CS0RO2tYLKZWyoL9owm0IDNggklzhiqErGjZMAmBziQW5MRyNb4ipAFwD7W JzjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680166369; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/pUGbSJeXIbqbiydf5b6Zg3qCqAFB/oHTtk54OkF+CA=; b=FTO2b/h5+YVziPs7nHr23DxlZg/sx5z8hCxCiY6OJ2aAEERWPonaMbpoP26HfVrMET 3OYue63UlLdHSdouAwEk05D6gOAuInuXnjjfDCdg4TqfRNaRhM7BracAZo2j90n3peqe gFLbKlduRxrZtNISY3za+GLuJx42QTGIFuvvFnnQnyOLCMlnWG5QwsREOPIb1wMu6XAN YuQi7OvkyaD3UWaSbVmDUyB3HwOrQbgWvp2oa9oerOPoFdS8AlptSbRiKYBm2dTbBNsd xiLzdHwedcBxwVAA6X/2O4c0T79sM7+61BhwJpUJMYCtlT0fby7l56FlrPrkJCOThmsi wfcw== X-Gm-Message-State: AAQBX9cSFwWYVFSXhiqHcYFLENm0hWqDzcqGtuXKlAVpzplxh9QctMP4 U8ptio+IMW6fEIJEz7pArr6CgWNbm8bAVAxXFyKigQ== X-Received: by 2002:ac8:5dd0:0:b0:3bf:c406:3a5f with SMTP id e16-20020ac85dd0000000b003bfc4063a5fmr75067qtx.7.1680166369621; Thu, 30 Mar 2023 01:52:49 -0700 (PDT) MIME-Version: 1.0 References: <0000000000003da76805f8021fb5@google.com> <20230330012750.GF3223426@dread.disaster.area> In-Reply-To: <20230330012750.GF3223426@dread.disaster.area> From: Aleksandr Nogikh Date: Thu, 30 Mar 2023 10:52:37 +0200 Message-ID: Subject: Re: [syzbot] [xfs?] WARNING in xfs_bmap_extents_to_btree To: Dave Chinner Cc: syzbot , djwong@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 30, 2023 at 3:27=E2=80=AFAM 'Dave Chinner' via syzkaller-bugs wrote: > > On Tue, Mar 28, 2023 at 09:08:01PM -0700, syzbot wrote: > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit: 1e760fa3596e Merge tag 'gfs2-v6.3-rc3-fix' of git://git= .ke.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=3D16f83651c80= 000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=3Dacdb62bf488= a8fe5 > > dashboard link: https://syzkaller.appspot.com/bug?extid=3D0c383e46e9b48= 27b01b1 > > compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for D= ebian) 2.35.2 > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > Downloadable assets: > > disk image: https://storage.googleapis.com/syzbot-assets/17229b6e6fe0/d= isk-1e760fa3.raw.xz > > vmlinux: https://storage.googleapis.com/syzbot-assets/69b5d310fba0/vmli= nux-1e760fa3.xz > > kernel image: https://storage.googleapis.com/syzbot-assets/0c65624aace9= /bzImage-1e760fa3.xz > > > > IMPORTANT: if you fix the issue, please add the following tag to the co= mmit: > > Reported-by: syzbot+0c383e46e9b4827b01b1@syzkaller.appspotmail.com > > > > ------------[ cut here ]------------ > > WARNING: CPU: 1 PID: 24101 at fs/xfs/libxfs/xfs_bmap.c:660 xfs_bmap_ext= ents_to_btree+0xe1b/0x1190 > > Allocation got an unexpected ENOSPC when it was supposed to have a > valid reservation for the space. Likely because of an inconsistency > that had been induced into the filesystem where superblock space > accounting doesn't exactly match the AG space accounting and/or the > tracked free space. > > Given this is a maliciously corrupted filesystem image, this sort of > warning is expected and there's probably nothing we can do to avoid > it short of a full filesystem verification pass during mount. > That's not a viable solution, so I think we should just ignore > syzbot when it generates this sort of warning.... If it's not a warning about a kernel bug, then WARN_ON should probably be replaced by some more suitable reporting mechanism. Kernel coding style document explicitly says: "WARN*() must not be used for a condition that is expected to trigger easily, for example, by user space actions. pr_warn_once() is a possible alternative, if you need to notify the user of a problem." https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Doc= umentation/process/coding-style.rst?id=3D1e760fa3596e8c7f08412712c168288b79= 670d78#n1223 -- Aleksandr > > i.e. we actually want this warning to be issued if it happens in > normal production situations, but given that it's relatively trivial > to create an inconsistent filesystem image that can trigger this we > should just ignore it when it is generated by such means. > > -Dave. > -- > Dave Chinner > david@fromorbit.com >