Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796135737; b=qyvXV3Rw7E0WFu057s5g9f7hXV/WfJO85uOWmpEN2WBq6M9IHVtXWolrkuSCKhW9Du8f +gg7f41iED7yy7cJwtIzwLWsZpOnHDVqTa1rjNa5uycCNeImDiPuIyYRwfuvbKv9nrKVQ SzDEg46XI1v5lDhm8MVzOBrSmJx3A5XBVWQxVyndUzoo8zJGZhjPgF9INgW/pQ+27eIje W1rtKhqeUu7UW3ZAyX0aa7n4YGbUjkxhgRQVMEKt9yVEEJSb6hL36yK/dKdZmJau49wkY JVCjvwVykCXOSotFawRrJ5KNMv5L2BJRAKlGPuXASxGsl9qTvSWNDt1oJm6BNfOBhHg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796135737; h=DMARC-Filter:Received:DKIM-Signature:DKIM-Signature:Received: Received:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-Developer-Signature: X-Developer-Key:Content-Transfer-Encoding:X-Rspamd-Server: X-Spamd-Result:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Rspamd-Queue-Id:X-Rspamd-Pre-Result:X-Rspamd-Action; bh=F8rZXwgteqbZbs17ttmtOi9dk6Yv88pwn4UCPhm5Pu0=; b=WuJr5ya41g+UhdfH3rYNpUjF2DOzWkR53rXZTyTLQPo6u8IEimpuUEoSYD0iRaWUiNte RDF/lejqB1PvjRvvp2G2mt1GSv/CNgiAqipoSPPcfd2u0jCqArDkwGl5hJ/pAKEDDBHmV WLl4P894bx/tM0H53312RLOnz2sRcBYBsdlCBzJ6BMvTlexLKqr9tRifIM7kldjUHFsAX VcOItarz3j1qxmoH6mAYmFIipdscRJBH/YlQszQk3ltIYatuHB3UfBNn8Rd/q22VmRavX CAv1L2C3Raxs9GUSNtGpEZBxVuXMjjYvuQM+Sni7TWvSgyYYfNesS3nc0i/nw7R3YcQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=UsheCFCJ; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=FpM7WhPq; arc=none smtp.remote-ip=195.135.223.131 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD34C606A336 for ; Tue, 1 Dec 2026 14:35:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AD34C606A336 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=UsheCFCJ; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=FpM7WhPq Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C33021F766; Tue, 1 Dec 2026 14:35:33 +0000 (UTC) Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1796135733; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F8rZXwgteqbZbs17ttmtOi9dk6Yv88pwn4UCPhm5Pu0=; b=UsheCFCJrYBa5Ya1DNM74GjjJ9eQnU9+LithwKo3Fg+CsFZIbQCP6IO3KnNk8+JolFidmz xbFPDWVdNfY3J/mPSyh0wtnjGvTX3O9VISpoNSJXfmTWABpV6rwWsB9DmlqCdt6lYtMNtC 1MPSyv4GOs+hxIvdrFao1sPlpgjIqSE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1796135733; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F8rZXwgteqbZbs17ttmtOi9dk6Yv88pwn4UCPhm5Pu0=; b=FpM7WhPqsIZFJpKkZw/1uX2UecrHiNfksdIAomoCMrVmHE7DI4xKYivPG9Hd2Bs6KXvZXq f44ALr7SphAZsWCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 9B3E013505; Tue, 1 Dec 2026 14:35:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id qjlQHDXbDmv0VAAAD6G6ig (envelope-from ); Tue, 01 Dec 2026 14:35:33 +0000 Received: by quack.suse.cz (Postfix, from userid 1000) id 065595153D; Tue, 01 Dec 2026 15:35:33 +0100 (CET) From: Jan Kara To: Christian Brauner Cc: , Christoph Hellwig , , Mikhail Rudenko , Andreas Gruenbacher , Jan Kara Subject: [PATCH v5 1/8] writeback: Fix missed lazytime flush Date: Tue, 1 Dec 2026 15:35:03 +0100 Message-ID: <20261201143522.483168-9-jack@suse.cz> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261201105733.18997-1-jack@suse.cz> References: <20261201105733.18997-1-jack@suse.cz> X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1480; i=jack@suse.cz; h=from:subject; bh=tLXfmzOP5aDRq6/jjTuDwN0YV3g4qhMuQ+lBEQh65LU=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBrDtsqDckjefXnIPfvqV9LY2Om2mltH57I/iZxn kiceOSv+1CJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCaw7bKgAKCRCcnaoHP2RA 2Z0RB/93eSqa3j4Gq2fwHC0sKn7DKGqArbRnpNLUfHwwfAOi5Eyvd302Z/lFYcAnHKcokTUrYPH hGsH9YqE2Ua1ExCBOlyw0vgsOznTP3yxfb4Byp/mu0odhx3FlquRXwD6FItDQ/Ctr1VsEa2lsMs VDAeqBUD/PS81R3fgTAOUd5efz1LGUrLQpzxgL4+bWCf4Rjfww/d/sOnfqiE24necZQcpz2Z+3a wGauSkwYXCKL3vg2bZPnBjeOg3ATtGN597Btszr8+CWlUXt+OfFlr0Udom3JVf49iSNCq9d7dZh ffuK4Z/wSdsTNt04tJtd5B7DWAnuCEwiBk5z+YBJYKIWtpKA X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Queue-Id: C33021F766 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action move_expired_inodes() moves to b_io list inodes which were dirtied at current_time - dirtytime_expire_interval or before. __writeback_single_inode() however calls sync_lazytime() only if the inode was dirtied strictly before current_time - dirtytime_expire_interval. It can thus happen that inode with dirty timestamps gets queued to b_io list, then fails the check in __writeback_single_inode() and as a result is just placed back to b_dirty_time list with a refreshed timestamp and so timestamps aren't written when they should have been. This is a very difficult race to hit in practice but changes to how dirty time expiry is handled on last iput() will make this much easier to hit. Fixes: 5fcd57505c00 ("writeback: Drop I_DIRTY_TIME_EXPIRE") Signed-off-by: Jan Kara --- fs/fs-writeback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index de77b6bc1dc4..65b1af2879e8 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -1910,8 +1910,8 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) */ if ((inode_state_read_once(inode) & I_DIRTY_TIME) && (wbc->sync_mode == WB_SYNC_ALL || - time_after(jiffies, inode->dirtied_time_when + - dirtytime_expire_interval * HZ))) + time_after_eq(jiffies, inode->dirtied_time_when + + dirtytime_expire_interval * HZ))) sync_lazytime(inode); /* -- 2.53.0