From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C84CB3876D3 for ; Tue, 10 Feb 2026 16:12:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770739921; cv=none; b=WQ5gwTyAmQPmWUw3M22ztx8GobCDYpLkV1oLziGJaHSH4dpPPQjroRCiDgZA4+IiRGQhDJvhaI74gbbqZJrsX3LPI422mtB2sPDWsVJ+YeNHIPXsWVr/6dKg68VeYRHzobU7u4cvfMSUJNs0LUSDFXigCi1ZDxfG0oy1zeXpMDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770739921; c=relaxed/simple; bh=rcwUUzRQ+nNfp/Q0W2b52PC8lI1R+ayfS5CWHPkazsk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FAo+5bbdyC5FIyAP7iyWbPYEEjtm+Wc9bQ3QErdseCZ+k0y67jfoNOzWSOZ3+56SIVguWIxdR0MaFlVpz6ihC2uhji69Ra0+Y+pIgZTdhYWzNy67MD9AcZjVmQV7cbrSMVElqcc576DWzCSYAYWVvP3SUva5M453NifjtM1Op4o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eJL2NnRZ; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eJL2NnRZ" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2aae4816912so17158295ad.2 for ; Tue, 10 Feb 2026 08:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770739920; x=1771344720; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0r2fUEvWGlF2e7USxRILxffKA5SaIfZKmd2JjKgC7zU=; b=eJL2NnRZY6Fx8GvLATrf+ifT8QISnqJfnXBO0cfd9xT7HEmCYZucF+B6MEbXvO+Gna zj5rdX7CEDOFb93Jh3+ByrytkmGtb+UqLtLKdF/DmeLk2FXLGh7gjlCNVEfbcM9X5LTE ifI1rm+djcMgDJPGe6E6rCXkcGqWnTDCeCKtPGp7lcGELdKvK+LQYq82vgprUDL4o3AR CYDCjbwx6CYVP9c63pNN4/Fltz8tn+1g6b2qzyivNkkclVxDnBJPMf4VzFkONk4rOKdo AkRBpuwGB3QK1YPt2lNZHg6IumwXXgNgwoDIiU2Y9FRamfyiRxh/ge+54Vt34EwVZiz/ VVOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770739920; x=1771344720; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0r2fUEvWGlF2e7USxRILxffKA5SaIfZKmd2JjKgC7zU=; b=Jw+2kqANptZr0BP9LCchH30u/wEi09IvuiqFixIvOh9Wnvbin4YaW3dBJvZyd2GroT OppqoAaRYycjeg18KGmOIOPQyjzai1ty3/XOHixs7MnmuG1g9irxR5GqlqEI7RI0vZkp wqSELRSGWBuBafynGcYWtBlzCBUONwPWORSjMKO/0SuLMMUJnYTYXVDkj7TFqvhSjrq/ 0zClKkNryYxJp2NqHx0IArxJdIlmixnkiw4YoBB9cWzwg3s5oVg+ayaG9MshaBAQQwRQ DFnOzeG7+CKs6VXu4ZB8IZKMGErIUubk+zO0G5vGrWhkpLuR5F52Wf2Lx42xQR/Nkprl eICA== X-Forwarded-Encrypted: i=1; AJvYcCVbo3jCjJIWyumLSWZpAvfpw7MZ6CJmzrbiDolVuw8QmicgAuhl0R4o19TuUxkzXlMfMpcnXW+CFUW9Tsw=@vger.kernel.org X-Gm-Message-State: AOJu0Yw45WhigKZGs+HjYJV5ncAQiPSwjsF/Y4z7WqhCMPFepuc+zHm1 URzZxivTLF82nAoaGhPdDPfWpRY1a53QvOB/eVJ2iY6NQOGpA8QLhCii X-Gm-Gg: AZuq6aKgAWnC3arUaWpUeX4bA9i3J3n7Gx6YUWUsYwAjElb3XhLjz478tgU/sMvN0wm nL/8y8Dx99VE7Q3WACC/zafjNgqfX8tuu/e6ZaNsqWvpZ2/bZYlwjGQJvfNQA+uBFUYbWj7XhTH NYCUfuaPil0jKdwcSbj6uWXUntR35loOVlj6C/m1rDmnoHHfUpa4E26Ooo+btIuwsgFYvqNI3Wk HFfXcvHlD8Vod3ExBDr4uRukdw7mM7EvPe3oxUUrTgquJvz6S8Z1GSXyB+v7lTvuQKrWYLrji8h SpPbs22t55lmejbJqKdA3UgpOPCtdsdE1RxQwp8kVMzBvpAH2Ql06UQpeGENKxSpCq0FIVne1cn 2zDdDiegKe4XuVRAhfxjh+t9qBKBC/d+J5UUUqqqoUEXgXrRQcTO62ZQ363alZfZVzaC59CqonR 1Z2w2l1EEKJq3Qbav/J4OzBOyi3TkeXWKml2kvhomGBZltb6jXyDd77Urb5cD1sPiArzRiewWP0 g== X-Received: by 2002:a17:903:38c5:b0:2a9:5db8:d659 with SMTP id d9443c01a7336-2a95db8e070mr135977875ad.31.1770739920092; Tue, 10 Feb 2026 08:12:00 -0800 (PST) Received: from ?IPV6:240e:390:a90:6d21:e579:6116:b665:1484? ([240e:390:a90:6d21:e579:6116:b665:1484]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a9521ec43bsm189495745ad.72.2026.02.10.08.11.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Feb 2026 08:11:59 -0800 (PST) Message-ID: Date: Wed, 11 Feb 2026 00:11:51 +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 Subject: Re: [PATCH -next v2 03/22] ext4: only order data when partially block truncating down To: Jan Kara Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, ojaswin@linux.ibm.com, ritesh.list@gmail.com, hch@infradead.org, djwong@kernel.org, libaokun1@huawei.com, yangerkun@huawei.com, yukuai@fnnas.com, Zhang Yi References: <20260203062523.3869120-4-yi.zhang@huawei.com> <1dad3113-7b84-40a0-8c7e-da30ae5cba8e@huaweicloud.com> <7hy5g3bp5whis4was5mqg3u6t37lwayi6j7scvpbuoqsbe5adc@mh5zxvml3oe7> <3ea033c1-8d32-4c82-baea-c383fa1d9e2a@huaweicloud.com> <665b8293-60a2-4d4d-aef5-cb1f9c3c0c13@huaweicloud.com> Content-Language: en-US From: Zhang Yi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/10/2026 10:07 PM, Jan Kara wrote: > On Tue 10-02-26 20:02:51, Zhang Yi wrote: >> On 2/9/2026 4:28 PM, Zhang Yi wrote: >>> On 2/6/2026 11:35 PM, Jan Kara wrote: >>>> On Fri 06-02-26 19:09:53, Zhang Yi wrote: >>>>> On 2/5/2026 11:05 PM, Jan Kara wrote: >>>>>> So how about the following: >>>>> >>>>> Let me see, please correct me if my understanding is wrong, ana there are >>>>> also some points I don't get. >>>>> >>>>>> We expand our io_end processing with the >>>>>> ability to journal i_disksize updates after page writeback completes. Then >> >> While I was extending the end_io path of buffered_head to support updating >> i_disksize, I found another problem that requires discussion. >> >> Supporting updates to i_disksize in end_io requires starting a handle, which >> conflicts with the data=ordered mode because folios written back through the >> journal process cannot initiate any handles; otherwise, this may lead to a >> deadlock. This limitation does not affect the iomap path, as it does not use >> the data=ordered mode at all. However, in the buffered_head path, online >> defragmentation (if this change works, it should be the last user) still uses >> the data=ordered mode. > > Right and my intention was to use reserved handle for the i_disksize update > similarly as we currently use reserved handle for unwritten extent > conversion after page writeback is done. > > Honza IIUC, reserved handle only works for ext4_jbd2_inode_add_wait(). It doesn't work for ext4_jbd2_inode_add_write() because writebacks triggered by the journaling process cannot initiate any handles, including reserved handles. So, I guess you're suggesting that within mext_move_extent(), we should proactively submit the blocks after swapping, and then call ext4_jbd2_inode_add_wait() to replace the existing ext4_jbd2_inode_add_write(). Is that correct? Thanks, Yi.