From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0A7F92D8DC2 for ; Thu, 11 Jun 2026 08:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781165556; cv=none; b=RpZNNnKGZ32W3mYhspyO2z7ti6vp+nS0H6zc9fVNbgnXtVma6RjIS2UAuHammaNASfNK4HxLu9VhUvLGsxP/SZTDV10dTFIC6j8/hcSwciqoB/AhNgJ7m2XokidjdDTgOO9uu+eC8qPAud70I7hqNXfVx59vp6u8NjODVUaG7fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781165556; c=relaxed/simple; bh=F5l3glq1jgNRAPate2WscRqqyxpyao/g51rbfyG3Qt8=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=K9URkptpM/FqrjL5pdva96VlZHjtlJJq2KsOxOgTD4w1+cAGJdqTGzLRf9K0oxUHzhvHiNhZKot0f/bCpYb64td+EwuCsQCrXmEX/tw1Tt24RaOcTOu5JPrAr7Oh0lVDYdwo1vb+M1JmFn1renaz4skpMKNi+QRT3A3OIeYcQVs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MIsJgg+O; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MIsJgg+O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 085DF1F00893; Thu, 11 Jun 2026 08:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781165554; bh=j/xYYVnQQ/67Yg5UycSzop9Vdemv8h8Ilxc2ghpNZb4=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=MIsJgg+O7OZoOnNpFY/TXQ8OeSI6/TJFtMFDF8uOnHjU1HGn5eHlqo0AeXcAytThL myYm5tCcBUNqKFh9uE0Op5h2modnZRUmZ31vkWBuUXUbdlN7LfBnCrtCrFJTOk/ovY i+OFMfBPBKbjcxlwl825NPfsZr2CdXPbDOvECGBgbxJHI6TWsp4q7xaVv67ta8APDZ nx1sPVA4HI/BaOIrBrfIcZlZfLkddeSxA+/vQXrQpx5y0xjbspa+6vAp1WLvk/IZYL MfeoKTndLkVQi5mcj4fv+jorZx4XGomQ+VgKQOsKiUyChB92SGhazQl1pH+ybj+icE OQq0vQ/ElXCew== Message-ID: <42d9f2ed-2402-46dd-a8d5-37dca2adfb29@kernel.org> Date: Thu, 11 Jun 2026 16:12:30 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, daehojeong@google.com, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com Subject: Re: [PATCH] f2fs: keep atomic write retry from zeroing original data To: Wenjie Qi , jaegeuk@kernel.org References: <20260527120628.2255597-1-qiwenjie@xiaomi.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260527120628.2255597-1-qiwenjie@xiaomi.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/27/26 20:06, Wenjie Qi wrote: > A partial atomic write reserves a block in the COW inode before reading the > original data page for the untouched bytes in that page. > > If that read fails, write_begin returns an error but leaves the COW inode > entry as NEW_ADDR. A retry of the same partial write then finds the COW > entry, treats it as existing COW data, and f2fs_write_begin() zeroes the > whole folio because blkaddr is NEW_ADDR. > > If the retry is committed, the bytes outside the retried write range are > committed as zeroes instead of preserving the original file contents. > > Only use the COW inode as the read source when it already has a real data > block. If the COW entry is still NEW_ADDR, treat it as a reservation to > reuse: keep reading the old data from the original inode and avoid > reserving or accounting the same atomic block again. > Cc: stable@kernel.org > Fixes: 3db1de0e582c ("f2fs: change the current atomic write way") > Signed-off-by: Wenjie Qi Reviewed-by: Chao Yu Thanks,