From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796466113; b=4mDVlnFs5WNaYzXcMcGOUGrFupZgYDbeJe/H4OeYXfkIKUl+1Uw5kumtLhmWLLGVworW OqNJi83BMGCkgVESIIqRv/NC30qwBmtF8xp414eGg91/Dkja5FHb9tc/H5ijo8l3qN6X1 JQqxy9As9KFanvZg2FnbnAMuY1rG/JWmwDdcEon0DkqNV+qQhcQi7/mhoe2fsU0xVvUw/ /PzLCgGQ/ibJHpLzk0Uii6ocOCOLsk1sfPjegmfIAs8jGKEbvfZIsIHABkQ+O6y1O/9g1 lnSH4cGyTMA0wDafKDCvKf/dNlfC4La3xB0Ep28Rbj6twqMxbcOgZVgXNSeQ5Npaitw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796466113; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=8G9u8/l18mWm01yRsxLA5iTtX3DIirGBz6bXb7KmbZI=; b=JPaII5maIao3LveThJxsWenRN9yKHA3fILCOkOwyaxNH7I+O1zYTTWKx/wtg2gCWNtLt GuX4lawvaV6LjMl6TRmXxafiTWLEGpmLNrqvifMuBmiRolQ3Oj4jKT24dPZnO45bEiku1 NToCUWW0RdsM4t0rXW+NNfeiKpbjyEeVUHMS1KpQDVHSGlYRmRUksiS6juSce604G/g+d DDq0uK5n3s1jkynmACknhUahkV9RmR6qlF6dJ+MghQUCu2raNha/qzemLL4NlhHckJeXL XApVVrX3lbA1eFKWNfDHM5TPxA6I6bJfsnosF9THikymlYxnmucMMs0Y2QYa7o3VEPw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=e2b.dev; spf=pass smtp.mailfrom=e2b.dev; dkim=pass header.d=e2b.dev header.i=@e2b.dev header.a=rsa-sha256 header.s=google header.b=V4rjYXWP; arc=none smtp.remote-ip=209.85.128.44 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3750606A322 for ; Sat, 5 Dec 2026 10:21:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3750606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=e2b.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=e2b.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=e2b.dev header.i=@e2b.dev header.a=rsa-sha256 header.s=google header.b=V4rjYXWP Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4bb85e07aadso19728985e9.1 for ; Sat, 05 Dec 2026 02:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e2b.dev; s=google; t=1796466111; x=1797070911; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=8G9u8/l18mWm01yRsxLA5iTtX3DIirGBz6bXb7KmbZI=; b=V4rjYXWPM5Q5q2FrbIF0+CgZiNTvgGdDfdzyaMCMzshcmbY9rjlafv7q08pItQk+D2 KGioJudCJVJJESVrYwIB89EkNxcObwYzGtxgNr850Lc+BSTi6XCzoozwQVjt9FjycU+x pYx7pt5k5Xl0J1r58V6+fB0aLsiGcdd9SsGhld7GorGHokzAtbm6mc+HnQqgdImhFdBU CfBAnu8AGRQYKAScOfkTvJ+StrRR8aCOAfdygKg7weWnQUDF/eXfkNTpFnacFdUpq+jy pg6uO4himjTmzAJHtWM5PWrcWcSj42XKJVoEhq68TOYpPIfT8ze/jMHrRVoredYlo0/O D24g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796466111; x=1797070911; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8G9u8/l18mWm01yRsxLA5iTtX3DIirGBz6bXb7KmbZI=; b=EYqpb/v7eVannX6ii6XkKDyyYgp/hwloGUhujTH0qzBGB3nnPyXaBb6PCUfDByAQkt 4pFt8Noi0UnoGG50YS/tLaGmD8drM8wrBkG2iac1KZVCbnZgxQ+ydXNnSd4Y4n8vbcUc bjYOksKUyjmmDbu3GF94JyHTVjIweznTtrYNVhTVGA14YD/Vu6NTH5R9EbVSAxmsJgIy suvy++bb3gg6ubZeMm6lUOZLmMhcGO5p8U29mWkSgD5+hlbcasX6Wh0oSMn16me2o4Bw UmqgPSvVX25nv/4JFJSeR3YQ30W2SfTycqTWXAaUTxNYV1kkk8fFYABaabnEL84qVuPk 1guQ== X-Forwarded-Encrypted: i=1; AL+hErHAWv93huFHs1N/wZeunWwNwSCp41mNCqLTlQlfzUxStYBkg7+0lFpNWoTN7vAiMZgIfYLHp4JucEEM@vger.kernel.org X-Gm-Message-State: APuU4Z/9CZhVSyhoUkLGtEXVrPc/j97t/TOAwefIpJnZpB+ypvDGRpId 9UYB1PIXiE5dszQJUIVJVKCv9rMm3Sl27FklZ2i9yYWm+HjE/0lQR1EWkeTpkgTcYok= X-Gm-Gg: AZFdTZeVlSm7+V7zqp0BvWLDIA0c14sHUsq3LvdFCxcOuWapadWSx6rf65gQz/m9srk QdH8psDRdF8jplM7DKxkGHkLGmwysZuXDkb1MHQH3cMkovTXC0AQlU68qd8H7eKPpJ/Rd+JisbE 0aYjBndAZUJV6bc+qh1f4Qg5NpnB1JgdbMCUe2lY99XD3gbX8+usx3TqMuR1xEwJPILJ8QhyE/t 7CdFxp9oMePJIyTVANR22tMobHtSrD7hQaZh4ovEJLYt4Col/8/PqkkiO/PNJGceQnF35qST5+8 vlKonKbNhRlil0G63der39j95fYbSHa8S3XS61SS8J4Qjgq9tBC7HCRnO/4XJ+39MEQEtNyMwbA J4uQqEXW62uVbtmozd0fpqBiSqg0j5E+nLkMl3pv8cGXgegSKtiskisrZbNtbpnk652WEUvw/pf 2JZXN9186IDGYF6Rblt3UK/iUJi1m7sJOX2nRj2xgZp4VR9KAm2uCEYSdMuyl4wAAwLfDRjYzct 5LvcQij+BB70Yr8PAKMvwMi5RQLtHWgZEhRy1eN+zAPXe2fG1R+UQ0ph1fX02lYDMqpamPze0V+ twMRgf7RLZ6/VKqbgY7M2EDBVs2RVQZX4RqXfSEYwFdWUj3eMA== X-Received: by 2002:a05:600c:1d15:b0:4bb:5de1:e90f with SMTP id 5b1f17b1804b1-4bbeb8cf94cmr93510135e9.31.1796466111206; Sat, 05 Dec 2026 02:21:51 -0800 (PST) Received: from fedora.sphynx-tuna.ts.net ([2a02:8308:397:e200:f9e9:8bad:f8cc:87a3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbea09a089sm228075775e9.1.2026.12.05.02.21.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 02:21:50 -0800 (PST) From: =?UTF-8?q?Petr=20Van=C4=9Bk?= To: Jan Kara Cc: =?UTF-8?q?Petr=20Van=C4=9Bk?= , Theodore Ts'o , Andreas Dilger , Baokun Li , Ojaswin Mujoo , "Ritesh Harjani (IBM)" , Zhang Yi , Deepanshu Kartikey , stable@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 2/3] ext4: convert regular file inline data through the page cache Date: Sat, 5 Dec 2026 11:21:40 +0100 Message-ID: <20261205102140.28450-1-petr.vanek@e2b.dev> X-Mailer: git-send-email 2.56.1 In-Reply-To: References: <20261126201258.1553196-1-petr.vanek@e2b.dev> <20261126201258.1553196-3-petr.vanek@e2b.dev> X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Fri, Nov 27, 2026 at 04:07:03PM +0100, Jan Kara wrote: > Nasty, thanks for analyzing this. How did you find the problem? I.e., is it > some syscall fuzzing, AI analysis, or real users hitting this? Real users were hitting this. > I have two comments regarding the solution: > > 1) We converted data using journalled data write to avoid loss of already > written data in case of crash before newly allocated block gets written > out. I personally never liked this much and agree this is asking for big > trouble (as your report shows) so I'm all for getting rid of this case. But > still we should explain the implications in the changelog - if we actually > don't use delayed allocation (which is what you did) and use data=ordered > mode, the data loss after a crash should not happen so I think we are fine. Agreed, I'll explain it in the next version. > 2) Why did you implement new conversion function and didn't just use > ext4_convert_inline_data_to_extent()? I don't really want *another* inline > data conversion method so if there's some reason why > ext4_convert_inline_data_to_extent() cannot be used, let's discuss how to > make possible to use it... The problem was its error path. If mapping block 0 fails, it truncates the file with ext4_truncate_failed_write(), which takes invalidate_lock while page_mkwrite already holds it. Changing that would have touched the buffered-write path, so I wrote a separate function that restores the inline data instead, as ext4_convert_inline_data_nolock() does. Sashiko has since found [1] that truncating also loses data in the write path: the inline data has already been dropped, leaving the bytes only in the clean folio 0. So the helper needs that change anyway: keep a kmalloc'ed copy of the inline data before dropping it, and restore it with ext4_restore_inline_data() if mapping fails. The restore path has a stale checksum problem, which my earlier patch fixes [2]. With that change, regular files can use the helper too, with no need for a new conversion function. [1] https://lore.kernel.org/linux-ext4/sashiko-outbox-240817@kernel.org/ [2] https://lore.kernel.org/20261125143841.928615-1-petr.vanek@e2b.dev