lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3dv6rb4223ngpj2duqm5smvmlpwhbvgyiksfkzmyfxhchejgon@eoo2kitdbdpq>
Date: Wed, 11 Feb 2026 12:42:06 +0100
From: Jan Kara <jack@...e.cz>
To: Zhang Yi <yizhang089@...il.com>
Cc: Jan Kara <jack@...e.cz>, linux-ext4@...r.kernel.org, 
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, tytso@....edu, 
	adilger.kernel@...ger.ca, ojaswin@...ux.ibm.com, ritesh.list@...il.com, hch@...radead.org, 
	djwong@...nel.org, libaokun1@...wei.com, yangerkun@...wei.com, yukuai@...as.com, 
	Zhang Yi <yi.zhang@...weicloud.com>
Subject: Re: [PATCH -next v2 03/22] ext4: only order data when partially
 block truncating down

On Wed 11-02-26 00:11:51, Zhang Yi wrote:
> 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.
> 
> 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.

Yes, we cannot start any new handles (reserved or not) from writeback
happening from jbd2 thread. I didn't think about that case so good catch.
So we can either do this once we have delay map and get rid of data=ordered
mode altogether or, as you write below, we have to submit the tail folios
proactively during truncate up / append write - but I don't like this
option too much because workloads appending to file by small chunks (say a
few bytes) will get a large performance hit from this.

> 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?

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ