From nobody Tue Sep 29 06:08:43 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 2E05C3AFAE1 for ; Tue, 11 Aug 2026 19:57:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786478265; cv=none; b=EVFsLSywFb63qKWoHz15pCC9bkAIgaeppes9BZwPlkDWTbqsa8QzOxpfy8lqkJ+birFHJ82t9hoScsr2HeZOa1irXMrkjDRMTlQtZzY0jSPVyOmfCwHNn4BLaYxktMjgIvBGR88oDmu2TaEzJG1OFGgF8Bf9NNIoeUhhXkSZx00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786478265; c=relaxed/simple; bh=lw/qBV6EAcsMqQGzBzbBCpBRsAqCuH0e7ZukyutHFVY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=U0drXCF+ywuehct7g3IWpT8nHLu74gJ6Fs6/W5a3098e5J0OrQkBuYwTCBk95Rgw/mtrFcTA0yqaQ7L3F3Vr+cIXIo8yJyGf7BP0HtD8OI/GdjfbBLuUMIVyirArdpo5uDiPlIbxrB6s/ElE3Ay0YSo8gdjwdFJ59b6/QVWI/bk= 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=EO59GN25; arc=none smtp.client-ip=209.85.128.52 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="EO59GN25" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-49557167508so699235e9.1 for ; Tue, 11 Aug 2026 12:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786478262; x=1787083062; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=P5I1h7k9sgU/X0BDonPRWDnDR4tKZyrHhT5a1azB5BE=; b=EO59GN25Jg/VxP5556P2MG2zkypYuO7Dgm6lc0m/y16EjoxoYLB0djTDaniwuO9rSB ZV4jcob2L+biSV2ju8MRFrq3nb2lFy6usJ5KfIKjMK4CQQIernaTyTY4INWYyrbMRXS+ 1BLkIEQwW67LkqX1GCNqX9vtU+QAaSTav+UlPoe5mjyiKXZjPV1bMtb7tiCWPh+K7cvL D85Mh0rXcG6SkRug8IInD+NKBYO9XN+ngBxCDVXCaGs0IGf7J2t14kdpFtRyEKeI2yqs JBc5pluq/7eT+NVrm59DL3tW4DUmtmRFvD7C1Ze5u8K11N0CIpApBrci9XpwBBgyI5jV 9ePQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786478262; x=1787083062; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=P5I1h7k9sgU/X0BDonPRWDnDR4tKZyrHhT5a1azB5BE=; b=slNqWcjdezxNzyeImge27o9povhvgaNFXHzOmhygNIQErKAsXDp6ds+aGxZLllup1P kfyBeOeWkRiFkl30K/sqG2PPeWVLVd0e5T652F8rlQgtu519VL7mNgt/PFO91dOrEGgD BVCABNlVJVgOTE7RPFNVVVlNCrHmTweW61il+jzyzeH2wou6RXbHiTGzv2MbRKpOFEIn vG7N+c3045EnHih0hoUtWgq2Gx5qQgXUzXJpq9digV/zElpVn+h1ElBxCFfd+gYF4A2L ucfEIGREB9JeDJNayEyeeKy/25Svftp37zfUwGFLQNSK40EvT/9jee5kHaNcNgV8XvNo cg5Q== X-Forwarded-Encrypted: i=1; AHgh+RrOGpho4ZEVgTenj96Tj+W2cSVjhaLcF3Tu4wPwTJOP3ATB8e5CEV28G7CNEUIrukh9bIYC/dAG1V7G8fs=@vger.kernel.org X-Gm-Message-State: AOJu0YweQlGYEIMCi/k5xgehwJrUA37aH12a3mLfZbXxopbSRXrzJV3d AJkV/24icczBlb9EU02zK/bNJ5q05ySR+VzZBaeBBsZfUCD7yXyyOpfM X-Gm-Gg: AR+sD11oyhAkTgrueUoxyw+MKT3NzBspfJk2vqzeF6ESaQlJ1LZk27njvIhF1ltGEen YmwAyqr00eTqXU82sDcDosc2sCQSoHt9WPENd91PPc9AI7iIrogz6Enij+bGlT+yY72/54sD0iI ahLDSssanMxwtSeb+fh+SR+l4eSKmInnfAvje7lg5UOlOoTKuZb7+llQ+OTgXU8LHw1mIbcQphK KCytdKzxy4UQoXEGl2TsozkIyoWh1VtnRuYMTfTgm86AJjmDniUr9XxxWHlOLG2aFbWtkzus6aC ATyNlnSnYbNw6KIkrhFWhp/ogy3nAh6g0hM1pDOwBy3Sp3RBrNhUhe6AC1GSFQe0e5ZYqs9VOt7 hy798OVuN1+ygblWkXUKwjoVNuOUkOeKXwE1+pArKJL9SBOgD87hXd+S6p3pCocdaZOFXJ5wnkX Tn4PLNTII4I7sanGbBbcpzk2gAdXH/jS8jzd9ZC1ymGEVbk2YVBZBnfGN5ppJQfKx/lwdA/vWzC 1YdF7FHMmsuG+G1L9s5NwdSN3Q647fTmFSU814nJRHJ4HVfnS4yNEAFWenCUBHCWi+Xiq6/36Yg afUzRofFwA237niOGFck/DgGnxE1ahcmw7cerkZ6CZLx04/Vl5oXLq6c4j4fOO+aurO0 X-Received: by 2002:a05:600c:1c21:b0:495:6396:8b67 with SMTP id 5b1f17b1804b1-4997a5f22a1mr38583495e9.4.1786478262211; Tue, 11 Aug 2026 12:57:42 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a02-3100-a133-e401-bc8e-d36c-2d08-c5e0.310.pool.telefonica.de. [2a02:3100:a133:e401:bc8e:d36c:2d08:c5e0]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48150c08dd7sm789136f8f.16.2026.08.11.12.57.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Aug 2026 12:57:41 -0700 (PDT) From: Karl Mehltretter To: Miklos Szeredi , fuse-devel@lists.linux.dev Cc: Karl Mehltretter , Joanne Koong , Jingbo Xu , "Darrick J. Wong" , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] fuse: fix GCC 8 build with CONFIG_PROFILE_ALL_BRANCHES Date: Tue, 11 Aug 2026 21:57:33 +0200 Message-Id: <20260811195733.38489-1-kmehltretter@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit 25307ca50b815 ("fuse: simplify logic in fuse_notify_store() and fuse_retrieve()") introduced a loff_t cursor and used it in place of outarg's offset field. In the min() expression this changed the second operand from unsigned to signed. With CONFIG_PROFILE_ALL_BRANCHES, GCC 8 does not propagate the range established by the preceding MAX_LFS_FILESIZE check through the branch profiling code. Consequently, min() cannot prove that the signed operand is nonnegative and rejects the mixed-signedness comparison: min(outarg.size, ((loff_t)((long long)(~0ULL >> 1))) - pos) signedness error This happens with GCC 8.1 on x86-64 and GCC 8.5 on arm and s390. GCC 8.1 remains the minimum supported compiler. Use umin(), which is intended for comparing an unsigned value with a signed value that is known to be nonnegative. The preceding bounds check guarantees that MAX_LFS_FILESIZE - pos is nonnegative, and outarg.size bounds the result to unsigned int. Fixes: 25307ca50b815 ("fuse: simplify logic in fuse_notify_store() and fuse= _retrieve()") Cc: stable@vger.kernel.org # v7.1 Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Karl Mehltretter --- Testing: - Fails without the patch and builds with it: GCC 8.1.0 on x86-64 and GCC 8.5.0 on arm and s390, each with CONFIG_PROFILE_ALL_BRANCHES set - Builds either way on GCC 14 and GCC 15 on x86-64, GCC 15 on s390 and Clang 21 on x86-64 - With the preceding bounds check, umin() changes the signed comparison to an equivalent unsigned comparison. Instruction counts are unchanged on all tested targets - Reproducer: defconfig plus FUSE_FS, FTRACE, TRACING and PROFILE_ALL_BRANCHES, then build fs/fuse/notify.o Stable backport note: in v7.1 the affected code is in fs/fuse/dev.c fs/fuse/notify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/notify.c b/fs/fuse/notify.c index 29578104ae6cd..3370ae344f751 100644 --- a/fs/fuse/notify.c +++ b/fs/fuse/notify.c @@ -153,7 +153,7 @@ static int fuse_notify_store(struct fuse_conn *fc, unsi= gned int size, =20 nodeid =3D outarg.nodeid; pos =3D outarg.offset; - num =3D min(outarg.size, MAX_LFS_FILESIZE - pos); + num =3D umin(outarg.size, MAX_LFS_FILESIZE - pos); =20 down_read(&fc->killsb); =20 --=20 2.53.0