Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1085510rdb; Fri, 1 Dec 2023 06:47:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKIjVWuvUQodGJNFFwGyxK+XXPZFwURSnLxYwKm0wQwwZRbOkkSld1Sgsg0l5KyskyhQ4c X-Received: by 2002:a05:620a:6690:b0:77a:6f81:59c1 with SMTP id qh16-20020a05620a669000b0077a6f8159c1mr22857031qkn.10.1701442034331; Fri, 01 Dec 2023 06:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701442034; cv=none; d=google.com; s=arc-20160816; b=cfpZnmB2KrVF+K7LAHQeQRnC9XVEP89HtXlAGw8xKq1xhhevjUT14AsDvQdmo3plIP t6QBCzRod7vF30s5sY9xyqlus2FzUQWMg8jtvlEkv42Xa80w5lJ6PpC9HVN7izp8xu0v JpurTplQ+x0VzRx2ZPl00tA7yl37cVHSJmGd4UT20dRVAIzOK/EusRSE/p1OtGhTgouP 5XBKrxaTIzaXvZ7cSGhbudVFmuVXA/ITLOC8XrR7uF2CKBedu8MRhu++fdldBnO/hLkt EfKRUToqcV/F/0GRspPD+MpTQhPXDkScPmo8FpiUupGa36THcvoPcDDJ84qnWydFIPXa jE7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PUwZlceDVLEqxoUTul3C7ObFnLoncs9F+0NCN18mqAM=; fh=ahekxxc5rs9YdxLroYT5zb536pgUjbD5Alth2c6QpvU=; b=UKIcxQtjirJMM61eoQB++0bx0YYCLlNi2Ek98J2ExT0IlAJtrpPr3gQbtBT7BuLerq 4rHJm6++/7gV7f37aaP8UWxGaUPZ06a6NE6NrmzB/TAjqUsT25cCeXK75rGAcPlAt+NW pnpr4tEOXZSqVnLCBTQbqzsi3BpTPXgAj4Vq00tq0SmlZzsxv5OObgFSYEUGmHJck10U Y/txOFH17a1+VvKtVNxscJH+hRVOoPcWeD6baorYhxlv2NpbE6KGjf3YPPSGRnE5Bgfk YTeVR0S/b4zwali2cOelURvbTTs/XB2mGfHHT7nTmnGUJUZplIX4K4gfEIQqNRB9pBwb sdJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=GhPhqXoz; spf=pass (google.com: domain of linux-ext4+bounces-260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y15-20020a05620a25cf00b0077dcdec7631si3418367qko.76.2023.12.01.06.47.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 06:47:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=GhPhqXoz; spf=pass (google.com: domain of linux-ext4+bounces-260-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-260-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 159B51C20CBB for ; Fri, 1 Dec 2023 14:47:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE7F53D0DC; Fri, 1 Dec 2023 14:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="GhPhqXoz" X-Original-To: linux-ext4@vger.kernel.org Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB8710F9 for ; Fri, 1 Dec 2023 06:47:05 -0800 (PST) Received: from cwcc.thunk.org (pool-173-48-111-98.bstnma.fios.verizon.net [173.48.111.98]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 3B1Ekv8i005614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 1 Dec 2023 09:46:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1701442019; bh=PUwZlceDVLEqxoUTul3C7ObFnLoncs9F+0NCN18mqAM=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type; b=GhPhqXozzanxriG+2wXljZlg/iQO0kyjS2aCCfFjZGzyDcl91Z9PjSn3Mu5HnMF7g mU6DhPekLMnyQB3YFB1DZcHsQmonQyk4KvJdRxpIRanf2u1LHbWsrJdsyr7zFjVWM2 DpcVUx5vT4QJtBG7lDJSsKl1MnCEGWcRUCPnPb1khj0dbN3uGyX4rFUPL6/Ucnojh1 NlbRhGZuAGSRuHpzVo3ZhewGhF0M8sFeyK8PVhDybHufiKyVhwn0qC0d0zRXoadULG nIP0hESVbF4Lb071A0o7zY4V4VnBPsOk7xtdGIU864fZkUJSC+boXlK/40hTi9bB9v BcP7K27aWoNHA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 5D25115C027C; Fri, 1 Dec 2023 09:46:57 -0500 (EST) From: "Theodore Ts'o" To: Jan Kara Cc: "Theodore Ts'o" , linux-ext4@vger.kernel.org, Ritesh Harjani , syzbot+47479b71cdfc78f56d30@syzkaller.appspotmail.com Subject: Re: [PATCH v2] ext4: Fix warning in ext4_dio_write_end_io() Date: Fri, 1 Dec 2023 09:46:54 -0500 Message-Id: <170144199127.633830.5706636957999053594.b4-ty@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20231130095653.22679-1-jack@suse.cz> References: <20231130095653.22679-1-jack@suse.cz> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Thu, 30 Nov 2023 10:56:53 +0100, Jan Kara wrote: > The syzbot has reported that it can hit the warning in > ext4_dio_write_end_io() because i_size < i_disksize. Indeed the > reproducer creates a race between DIO IO completion and truncate > expanding the file and thus ext4_dio_write_end_io() sees an inconsistent > inode state where i_disksize is already updated but i_size is not > updated yet. Since we are careful when setting up DIO write and consider > it extending (and thus performing the IO synchronously with i_rwsem held > exclusively) whenever it goes past either of i_size or i_disksize, we > can use the same test during IO completion without risking entering > ext4_handle_inode_extension() without i_rwsem held. This way we make it > obvious both i_size and i_disksize are large enough when we report DIO > completion without relying on unreliable WARN_ON. > > [...] Applied, thanks! [1/1] ext4: Fix warning in ext4_dio_write_end_io() commit: 619f75dae2cf117b1d07f27b046b9ffb071c4685 Best regards, -- Theodore Ts'o