Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp459394rdb; Tue, 5 Dec 2023 09:57:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFeTm+cMFrblw0cX/QP0qMXT0djXf9iUElA/fhJi4FgIDCi4xG73VvxRnriTsQmEFCL7tvl X-Received: by 2002:a05:6358:299:b0:170:2f86:392e with SMTP id w25-20020a056358029900b001702f86392emr4061060rwj.60.1701799049747; Tue, 05 Dec 2023 09:57:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701799049; cv=none; d=google.com; s=arc-20160816; b=plLAuHfKyojXqMQCOsju3jOwazm4JtCidI2khqxrgLfBn0Wkl30b19st90tOH8gJ3/ ZGgKbqur94WgK5djR9+4VDJDhUedmwE+im3wczvg4DidhrzTYoACSBuMMpFMvHJeWyKW UhTdjQ6v+3fmYRPaidB4T3hbZCdFY2LwX06KU8vXL4XJO7LvK96NEgJY7zNJ/OBvShjJ ESn462TLFEHpHoA8aXgj84L72ANfhLb+onqPN/n5At1RcwJCzgjiYawTahc4x8zmsEfr LzhknlTCz002RPza5DxRXmkN5r44IEIdIVgrxelwvU+64tZDygcAEmpKdeONUmBhwHuF ixRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZWLBt99RobgxJzbo/ZyGn7BksTpOR1RNZYK22ROlfGE=; fh=y5NnG8E5BsVCLHSMa2cp1v3Qr2a9eTA8HSV2wOWPJbg=; b=wj9MGagv8NoN4HPg3gybhKdj/mCpTgmotyAQlqEXll5CD8ojRui5BaXsz/o0Cw9g2N Z6W93WTn1pat9Ic/lRoQRFbut0+6klGmwTtQ3t8m0yDuhckgyJUtfsDabGWQAk7UsuSJ mHfFUH1naiAtPLGnc3E2ZRj5CyzPEjVkiGeGoog9ot4LTHIs+6k/pgF3qbxlvxY+i+wI GqKeZ/oJzPP/WK9bJrpoeyfoVnYQr9sJXobifdZBcioMBuS+ht3L7lk97Sd/WE46lGSK nGsUZ5HCtUrqojZTY+K4wtVasWWEU4D9RZ0Rp/ZInncVMxw4gxxFAf2X6SiMOB4BMRXh WQ4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wT63OINb; spf=pass (google.com: domain of linux-ext4+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u6-20020a6540c6000000b005b982b93780si9943739pgp.251.2023.12.05.09.57.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 09:57:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wT63OINb; spf=pass (google.com: domain of linux-ext4+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 02A7D281EC3 for ; Tue, 5 Dec 2023 17:57:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 994CE6A33F; Tue, 5 Dec 2023 17:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wT63OINb" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA57D6A329; Tue, 5 Dec 2023 17:57:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1156C433C8; Tue, 5 Dec 2023 17:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701799042; bh=2gbDWzlz/2HnpVET7DLNA3XD6qtbpPe9oj2Q4zkjV3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wT63OINb6S5Ij848WsI6aixbKVJlhTO9f2H0Ppqr7s/mp96Ssg/qFvvnXGxwd98a4 9ygGhIW9dfqPPq0vXCHkH5vu/WzpAd01068vX9XsnIepHCxr5Slzy4dVPAKTTON5b0 a9RyO7xNqN7P8tlNKAdcxDalLfu3ndq9WWESrfHM= Date: Wed, 6 Dec 2023 02:57:15 +0900 From: Greg Kroah-Hartman To: Guenter Roeck Cc: Jan Kara , Daniel =?iso-8859-1?Q?D=EDaz?= , stable@vger.kernel.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, shuah@kernel.org, patches@kernelci.org, lkft-triage@lists.linaro.org, pavel@denx.de, jonathanh@nvidia.com, f.fainelli@gmail.com, sudipm.mukherjee@gmail.com, srw@sladewatkins.net, rwarsow@gmx.de, conor@kernel.org, chrubis@suse.cz, linux-ext4@vger.kernel.org, Ted Tso Subject: Re: ext4 data corruption in 6.1 stable tree (was Re: [PATCH 5.15 000/297] 5.15.140-rc1 review) Message-ID: <2023120643-evade-legal-ee74@gregkh> References: <20231124172000.087816911@linuxfoundation.org> <81a11ebe-ea47-4e21-b5eb-536b1a723168@linaro.org> <20231127155557.xv5ljrdxcfcigjfa@quack3> <20231205122122.dfhhoaswsfscuhc3@quack3> <4118ca20-fb7d-4e49-b08c-68fee0522d3d@roeck-us.net> 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=us-ascii Content-Disposition: inline In-Reply-To: <4118ca20-fb7d-4e49-b08c-68fee0522d3d@roeck-us.net> On Tue, Dec 05, 2023 at 09:55:08AM -0800, Guenter Roeck wrote: > On Tue, Dec 05, 2023 at 01:21:22PM +0100, Jan Kara wrote: > [ ... ] > > > > So I've got back to this and the failure is a subtle interaction between > > iomap code and ext4 code. In particular that fact that commit 936e114a245b6 > > ("iomap: update ki_pos a little later in iomap_dio_complete") is not in > > stable causes that file position is not updated after direct IO write and > > thus we direct IO writes are ending in wrong locations effectively > > corrupting data. The subtle detail is that before this commit if ->end_io > > handler returns non-zero value (which the new ext4 ->end_io handler does), > > file pos doesn't get updated, after this commit it doesn't get updated only > > if the return value is < 0. > > > > The commit got merged in 6.5-rc1 so all stable kernels that have > > 91562895f803 ("ext4: properly sync file size update after O_SYNC direct > > IO") before 6.5 are corrupting data - I've noticed at least 6.1 is still > > carrying the problematic commit. Greg, please take out the commit from all > > stable kernels before 6.5 as soon as possible, we'll figure out proper > > backport once user data are not being corrupted anymore. Thanks! > > > > Thanks a lot for the update. > > Turns out this is causing a regression in chromeos-6.1, and reverting the > offending patch fixes the problem. I suspect anyone running v6.1.64+ may > have a problem. Jan, thanks for the report, and Guenter, thanks for letting me know as well. I'll go queue up the fix now and push out new -rc releases. greg k-h