Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1556825rwb; Tue, 27 Sep 2022 15:07:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7r1ryAC/GUy/EK/dGu9aUF039FoBOg9lVhrduIfo16JBAX4zaqA5trVCBDH9JjIxEL5ajk X-Received: by 2002:a17:90b:4b90:b0:202:65da:d658 with SMTP id lr16-20020a17090b4b9000b0020265dad658mr6782386pjb.130.1664316469673; Tue, 27 Sep 2022 15:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664316469; cv=none; d=google.com; s=arc-20160816; b=d7ESl8WMI5CWWWBFjnxkvWKu1HY1nk+6zpBc6WSrfcl/GLrwM3fJ+A+LAECHlM1xCq JmCMXnZjsS9ETY6QUnf6HY0kiZz4B8sLCpN3av8hUMTjRxwEvKOd2XyiKX+26o5a6kIE elXhD42nosatOA9Z1no//T08b4gJFAMqo9x1m5sE0r2/ZmRlBd7EtuXxfUzxT12aH0GE oX7jjY5Nq1HBUCchFsZltRuaUvIj72+FeW663evWBOtOyp73XRegBvRmkYSe7FuxES/1 IVn+aPg+Lx5UHuz8HqzGkfLasiU9mEG7+Bav+OJU/TqOz9/AJKpszlTNXtYLZJ6163hd eyig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z/dH5MAQt/MqY2/ExabwEofN5yOiVaRztYjMARf3e7U=; b=K+D31fH8/RLzH3KuaE4BdIKpMzAODxolE3NZd9L1B4KjzRyHi94tUzrpL4eQUFrWKC GOO09XR7qM8kCcMht67A5OTVca1cG9GEmEAOW/ymdzwBZ0CyEtOCTeoRly0J5sn9mVKr bY8BxZKZSzEN4YNrzUHcAl8H1R4VVXcqs+5Mj8Fz99wDXD7zybY/F5FBvKoNs23Kx5GK uEJXJ8UmwR2rkeQQIcyNUgAf61FFJeYI6+Yxzx1PWSWFgbVFNnNfacsOsjYrc3ftLtbN BzmR4Jq6wMomm1id6v8vSuGHWhxpfE6ntr/FtZVvNYSfZw7UyfKv6Z1tBmGsIIurrNZT zojQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=LzHWo9QP; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a6541cd000000b0042bc59df111si3239188pgq.305.2022.09.27.15.07.34; Tue, 27 Sep 2022 15:07:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=fail header.i=@mit.edu header.s=outgoing header.b=LzHWo9QP; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231881AbiI0Vxs (ORCPT + 99 others); Tue, 27 Sep 2022 17:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbiI0Vxq (ORCPT ); Tue, 27 Sep 2022 17:53:46 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8187092F41 for ; Tue, 27 Sep 2022 14:53:45 -0700 (PDT) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 28RLrbGB032591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Sep 2022 17:53:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1664315619; bh=z/dH5MAQt/MqY2/ExabwEofN5yOiVaRztYjMARf3e7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LzHWo9QPZv2Xo2LJK06saaYOg59VbSJS1rdqiXlmrcRvUVNC9XLh2dMhVUokIPO4k 1e0CQbz0/4vCuSESzZ11OC6ci8H/rFtGeswdGF07/GBnlJJIZWcKfWiwZO8dAS7/W3 diPrNmrjayfExb2fEVJQCyTTO/aXaOpvGbGuM5Tjc5oWxW18dQANYJv5s4jOy9V4bv lhozWrv545NlRUhUuQZyAqkjJl51UoGNPiNX0+5ePExLvScFlcqn99zultb4w/79h5 PJdFwlJ4BiWoy664hyvEBxpCJIIxTRCubrFAGGtycDgS4UviAf5hPUjSeZx4XWSdkp 91Kfm50wzCcRA== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 9E92715C528A; Tue, 27 Sep 2022 17:53:37 -0400 (EDT) From: "Theodore Ts'o" To: jack@suse.cz Cc: "Theodore Ts'o" , tadeusz.struk@linaro.org, syzbot+bd13648a53ed6933ca49@syzkaller.appspotmail.com, linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4: Avoid crash when inline data creation follows DIO write Date: Tue, 27 Sep 2022 17:53:32 -0400 Message-Id: <166431556705.3511882.4814006809885292570.b4-ty@mit.edu> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220727155753.13969-1-jack@suse.cz> References: <20220727155753.13969-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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-ext4@vger.kernel.org On Wed, 27 Jul 2022 17:57:53 +0200, Jan Kara wrote: > When inode is created and written to using direct IO, there is nothing > to clear the EXT4_STATE_MAY_INLINE_DATA flag. Thus when inode gets > truncated later to say 1 byte and written using normal write, we will > try to store the data as inline data. This confuses the code later > because the inode now has both normal block and inline data allocated > and the confusion manifests for example as: > > [...] Applied, thanks! [1/1] ext4: Avoid crash when inline data creation follows DIO write commit: 4331037750fdd4c698facc8a03075f88f15ffbe6 Best regards, -- Theodore Ts'o