From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796466113; b=nn3X6putCnAAPf6x5AdIdWViqXWl32ztzVQQa0jA9MQIwTpl/Qyff05R9JbC89o9K/z7 A0NhbCPIauBqt2Gm06Z/Xtk71SKLHAFvunKZ2m0ayt3EG64DFf/jhkRcr6Ar+uOFTfGy+ Hhwk/abC1psayHOIGTbK340OMwXT/fi+XXhEeWYfGM1BB6j+C2QKzAay7n4uW+FPzANqI cL6IYl1Ra52P5wBElyrTgf1lUXbVl8d56ZdVINHQldbAxRI5LkhauHRfziEi+NvRbfw21 IJHtlHuB5pWX08EmyTHguOMlvJpnt78LaqeZKFp4KZcl1cTWoZ/DKHKn85RetcEBT3A== 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=ntf4lSIV3z4masrcmzGrwcC4sMIU2u8JAXwmAUObCnKKin92gY1578iU6MKDxRhrw+2X karLzImZmwN+a2g49yrnC0KxwdE9Fa1FMIL/XTSBI/2iRQD76hf6H8XrOxIdSUJKANkPA dWTLUA0UTq9CTYeH2sW0z9NunbbwHnsmDiulVNJfDr2q6xtlfHxTr/U0+QUtxsxD27sKx vD8jDQ3caKciIzwfow+BkNcvFMt4ni5tuJrXT0Tn2IpsKZIXSmEKmURyDCRKqh5cB9pJS GfgSpPZjKfRAf3PDYyRZkP6AEfXhUNQFpj2YfxqeQyOYcWDl+HNne0M4A1YJDOzjnYw== 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.221.54 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 DD9F5606A32F for ; Sat, 5 Dec 2026 10:21:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DD9F5606A32F 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-wr1-f54.google.com with SMTP id ffacd0b85a97d-4a68190a2a7so1341606f8f.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=X+dxqGsrsOtNpEF4nVOQHLbt6097yf55eWJiB3W1SOcyhCUjhopZTWVSI9CfZ4YT8i FN69BnvlEagkrGBHNNYb6Tt6p4gaykoIWamAgIazCaAC2TFhrBbq2sv6OBFR0O87OSUT kF2Dcai51QbDQVDrixsn9oudUcqGp28MGOkpr+QLih9ycxMzcirPzZSSbxBqQVV+90xy FFgL6R8qtKveQ6nPAWqnpH5oQcZ+hpHPa0GZrFpdGYQGj31nCp59jGwiQlTuIgeNWgCZ uGXyfQCLl770ZO6Y/9HwDUhCL2zqrnhOn1YTYPEFSoRZ4XG5iWk8q8RbmpO4JVZLUS5V TW+g== X-Forwarded-Encrypted: i=1; AL+hErGLDnxiM51TSTjplGytpZj5/uFT/WZ6ak5sLeXctzpNxYG0LpicFI9JnWDXupAeIM5RNxiZRAI=@vger.kernel.org X-Gm-Message-State: APuU4Z9Ah1c5RpOmoYMVy1BxRxewD/vWUvTNb4Zn4WFj0a7joIpYD821 T/JsDwUqr0rhV0itVYle15loo+iXbKWjTlzj36Kyr9SxIPkJQghGBscbpMUHgjrMpR0= X-Gm-Gg: AZFdTZd3DroBBxhwTOpYA1TMMyzF4glA0eQgdUKsp6OAPtbuPPmXITRGfbcS25MfdNM Ou9fsawAhESttI9eRpp/91dmvFR+259ASg1ryk7qOoEEEfLvLi5SpSodGo7PDqgM2hCjoKTIy9H 91/DpH/uIv0yQHthiwJ3dQTmVxP1nbJ1nSjfwtiUqx3DgIh47lq5xAmBTl+nn9pqRt+FePwYpFN QDRoI21HaOKFtD+snImjnGd+M8XRyGIIbRZfagmC4FTu5kPSmGHwBb6NDndx2NyXfxsOjHQP/2g 92fe9iMWPLgGwqrueBS6YG8qiIv+rcnWLVvxn54ylv9jIRL+UEh93wmS0q0iOHT79/gVwLx71Mq gWLCgaqbJV/qN+CX39iQkxHLao/5GkLENJ/KV0lc6EebUQsDmKdiXYEB8C3qy6Qu3oWgayM/0O7 oe3IBRwK7fNxGmH0BOQcZCgP9WZZaC7VEpFqipFHJzuPnE+l1watoK69NUAsxXcmHW9HuDFk+Bv CeLSB3sX/ceAiwjH8SvhMADMR4vv1DC8nRn4hy0XAwBcLrupUWWgeBmJQ6AwcI4nd1d6J1rwY9q CygTKBO2zAKbwTA6X21LbPRs5qML525hvcEvJxDpt5emHsFusA== 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: stable@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