From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7125544E035; Thu, 8 Jan 2026 14:21:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767882109; cv=none; b=j9BS5IawZMIFyKlUB6gFrC/sV9/7Oq49WvZYyaWi9Hrkag9IbfHADZhNvzvfhcj+uBlW59ur9u6JkkQBSrX7qkvCpqG6l8s6qMnW6Zuvnb3E9AfxDXvhAJ4JHVBKy+Z7bG/LeAkXyKrXKdkWOqJi9tLsdUWl7prWx+LFD9HSihU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767882109; c=relaxed/simple; bh=5tJepZdBm4NT9tyjBB7PXASujyH9KkjsFzRaJR+9pl4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W+llRZnGXSf+K9YKqCtF9pGFHXJLvxavY8wVuvpXZMPCd+QSl+nTM6md7GZgBaATRBbD6UMPlkXTUlmeMQPBkI0yjx6T+dnnB6LlO9aeZsl3SwuVrldzr0ApwWMpdlQh7GiGh/dw0SIBiYAPdiJGTJm93uPH6ZAARbIULeoshB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=RdRZM0th; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RdRZM0th" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=dwwZ/yOU7SW1prK7b5bp9EkEBz6f02bqYmxcFFUDJQk=; b=RdRZM0th3MexAdg4BYXcprKzWL qKIf8k9FWj0refwqaCOxEeK161s0QQWu6adggTvMzXXz4jgeeG7h0EhYHIR8nRKP1UBSHMmRIHA00 LJbOboxA6kJnns/yUZupNt9rwQ8SaGp8L6t7GGiyIkTIcdMF+r51XiSLKk1ARgg8OADVZi+RZqpWI tRMOzKvd+PbqGPggfemC26C3oDDF4jiqIImlOFcF7BCgIvepUgKqFa8JcUa1WrZAas9EF7OFhuxXX DooT3+wFQACjnht3zV4nWfWpAgjnTg2d/RlchvtRCAPmnvGbl6QKHGZae27DW3FwgNzEtGb/giJzU 6TOiZyrA==; Received: from 2a02-8389-2341-5b80-d601-7564-c2e0-491c.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:d601:7564:c2e0:491c] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vdqtU-0000000HK5r-0Aie; Thu, 08 Jan 2026 14:21:44 +0000 From: Christoph Hellwig To: Christian Brauner Cc: Al Viro , David Sterba , Jan Kara , Mike Marshall , Martin Brandenburg , Carlos Maiolino , Stefan Roesch , Jeff Layton , OGAWA Hirofumi , Trond Myklebust , Anna Schumaker , linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, io-uring@vger.kernel.org, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-mtd@lists.infradead.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH 11/11] xfs: enable non-blocking timestamp updates Date: Thu, 8 Jan 2026 15:19:11 +0100 Message-ID: <20260108141934.2052404-12-hch@lst.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260108141934.2052404-1-hch@lst.de> References: <20260108141934.2052404-1-hch@lst.de> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html The lazytime path using the generic helpers can never block in XFS because there is no ->dirty_inode method that could block. Allow non-blocking timestamp updates for this case by replacing generic_update_time with the open coded version without the S_NOWAIT check. Fixes: 66fa3cedf16a ("fs: Add async write file modification handling.") Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Jeff Layton --- fs/xfs/xfs_iops.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 338f3113f674..1cdd8a360510 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -1195,16 +1195,22 @@ xfs_vn_update_time( trace_xfs_update_time(ip); - if (flags & IOCB_NOWAIT) - return -EAGAIN; - if (inode->i_sb->s_flags & SB_LAZYTIME) { - if (type == FS_UPD_ATIME || - !inode_maybe_inc_iversion(inode, false)) - return generic_update_time(inode, type, flags); + int dirty; + + dirty = inode_update_time(inode, type, flags); + if (dirty <= 0) + return dirty; + if (dirty == I_DIRTY_TIME) { + __mark_inode_dirty(inode, I_DIRTY_TIME); + return 0; + } /* Capture the iversion update that just occurred */ log_flags |= XFS_ILOG_CORE; + } else { + if (flags & IOCB_NOWAIT) + return -EAGAIN; } error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp); -- 2.47.3