From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1F15237F8DA; Mon, 23 Feb 2026 23:41:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771890109; cv=none; b=fN9/3CE6VfmDz3vkASPGgL5Bf1UU+HCy1vnMaIaYU27h2WBn8FPev9JaAial9t8CmtDAOVIVKcheXpjD9fRH9h+d88vHXmqm9XuxUvvjY2B1Spg+o6BI+/5uOo68sidP0u0pK0YeRQ1yCidvkfLqE7aOM2mpv7V/sfxv47jXqr0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771890109; c=relaxed/simple; bh=gcieDKYXwTRyZuRpNCDSCjey5EzxB3X5vefqgoEinvU=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tJwhd2bjHCFxNWaJ4m0ikzYzCiY3m6beaxzGarnRU4IRWZaUwGT1IJZhNAtkzyqQcZG4oSvBYMA6+6IIVRB9gQf6aleJsp8Q1qPJXB9z0X5VSRLl8qRNV2ABlDSvvbPJ3FqMDvThTXsjj5NFkQNkeh/+zsDHJmZe3t1t+MyPHkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YdhH5a6d; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YdhH5a6d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0FC5C19421; Mon, 23 Feb 2026 23:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771890108; bh=gcieDKYXwTRyZuRpNCDSCjey5EzxB3X5vefqgoEinvU=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=YdhH5a6dcYmVBrGzHLE/J1fNjVwZPjcAGukxORZzQbD6iTxi+TJ65VdrzWMXSLob4 nP8oWYAnB0ZXTeROlnXtUKw9fkAtRAG/68iotEcYiz6txcao9qD0NevpDduL3P4uVn b8ENQXD1Y38P86N5WvPlrUEO3rrAdsvxdGP+cPOwt0zSYpvjPVB1cyVd+1WToWmABX 6cERmsRH7eu367TXvhK5QRKmtJzCYT6SNGq0HFsBZeAT2RFkiYZ32Jd9z4bAUbggl9 Irf+G+4+hnB7asbsUOWBA1PUI7BUPmoRFC14chYOiYveUN6U7kOWDqyUPodW1KvlmR 5IWlAmd8/C3Og== Date: Mon, 23 Feb 2026 15:41:48 -0800 Subject: [PATCH 02/10] fuse2fs: skip permission checking on utimens when iomap is enabled From: "Darrick J. Wong" To: tytso@mit.edu Cc: bpf@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, miklos@szeredi.hu, bernd@bsbernd.com, joannelkoong@gmail.com, neal@gompa.dev Message-ID: <177188745216.3944028.15549582531631012376.stgit@frogsfrogsfrogs> In-Reply-To: <177188745140.3944028.16289511572192714858.stgit@frogsfrogsfrogs> References: <177188745140.3944028.16289511572192714858.stgit@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit From: Darrick J. Wong When iomap is enabled, the kernel is in charge of enforcing permissions checks on timestamp updates for files. We needn't do that in userspace anymore. Signed-off-by: "Darrick J. Wong" --- fuse4fs/fuse4fs.c | 11 +++++++---- misc/fuse2fs.c | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c index 428e4cb404cb45..b7ee336b5e4546 100644 --- a/fuse4fs/fuse4fs.c +++ b/fuse4fs/fuse4fs.c @@ -5276,13 +5276,16 @@ static int fuse4fs_utimens(struct fuse4fs *ff, const struct fuse_ctx *ctxt, /* * ext4 allows timestamp updates of append-only files but only if we're - * setting to current time + * setting to current time. If iomap is enabled, the kernel does the + * permission checking for timestamp updates; skip the access check. */ if (aact == TA_NOW && mact == TA_NOW) access |= A_OK; - ret = fuse4fs_inum_access(ff, ctxt, ino, access); - if (ret) - return ret; + if (!fuse4fs_iomap_enabled(ff)) { + ret = fuse4fs_inum_access(ff, ctxt, ino, access); + if (ret) + return ret; + } if (aact != TA_OMIT) EXT4_INODE_SET_XTIME(i_atime, &atime, inode); diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 3cb875d0d29481..473a9124016712 100644 --- a/misc/fuse2fs.c +++ b/misc/fuse2fs.c @@ -4930,13 +4930,16 @@ static int op_utimens(const char *path, const struct timespec ctv[2], /* * ext4 allows timestamp updates of append-only files but only if we're - * setting to current time + * setting to current time. If iomap is enabled, the kernel does the + * permission checking for timestamp updates; skip the access check. */ if (ctv[0].tv_nsec == UTIME_NOW && ctv[1].tv_nsec == UTIME_NOW) access |= A_OK; - ret = check_inum_access(ff, ino, access); - if (ret) - goto out; + if (!fuse2fs_iomap_enabled(ff)) { + ret = check_inum_access(ff, ino, access); + if (ret) + goto out; + } err = fuse2fs_read_inode(fs, ino, &inode); if (err) {