From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 D1DEA3603EF for ; Wed, 5 Aug 2026 07:14:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785914061; cv=none; b=HYmJaBR6cpZ4fV7J4Xg6VZ5Wiq6KnYEH4OD42AfcZwBMuFi3B1Bk9VUbMDzk8ACQSgZFQAgBP1K9h7lqNLBpag0cEAxE1t5phaBCZ2KbgGFBro19cgix2k1wmeUVaqidLcvT0gdBn/9PUFxWhWM638zpAvPfQw4O7ETx208lD4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785914061; c=relaxed/simple; bh=J6qYZUiLa3PQDxYt5MfRmbE/eSrWZpjv6rUJGu1HGyo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ndJTOd0eyxAqYkN0ueYRvR3bDgECiZNt7a3viOOKZoKEisKxLCYSoYauSmRWs5THMlv2rtqWBwy6DytZk1WqZqL1o+I0s+zHQxQ8aNo2DoYrlx8IrzCtgounmlSiHXw3h0sNY8ccheu8+WcZVTIUy+Z+DlSoacIlQK5y90O7mro= 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=WJqR2h3o; arc=none smtp.client-ip=209.85.216.46 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="WJqR2h3o" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-38e041ea211so747824a91.0 for ; Wed, 05 Aug 2026 00:14:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785914059; x=1786518859; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=m6as8M7FVd7c+UbPqlYJNNyB2XLvJfla5C2MEVFuars=; b=WJqR2h3ocUWGZI8BQlYhH2GvZDYuC3q2sPW+oz11yaaOwaiG/XJwIuxblbj+SGVvqS KmyRF268AyPmtmMR3+nAi5+AZvrHWqCPpU9d2+7AOH9ZRxCFJjTAeqHXfiQe/bAq9Iyi zA/FpK91bOt351dXfYDdPiodKl3oNsTfVbUEHJBE7R671KsXvCGzMwfVr26W66y0CkLD P22ZJF9J1Ubsm+CLlQs7CExh9QH+UKMN6AVnNNbyuGIdJFG8toXXYjbQPaK6JAUFxCCD c8mJNrQsI7nK1+TGYpzQMq45gLqBl8Gy4q8kfpAnbD0MsIgkOIShPffgziVOxBtPFLeh lEbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785914059; x=1786518859; h=content-transfer-encoding:content-type: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=m6as8M7FVd7c+UbPqlYJNNyB2XLvJfla5C2MEVFuars=; b=UOUbMdCZnTfUZhDgl0hVsylVW0LcVbq+H0zUgflS24+vcplcnqzoZloC14NKy9PPec F+vgHRqJVztXPPPr9xXBWlQQyDvCGROds5ar+hCEad2FtE5BNiu9ExbwGu8kSKNxgQx0 1SXpNcQfxhtMw5+gEUOE7KQCRcQEQjYUI1uy+a/uZAvcBIrHBxZ1mCUhtsgETKz4HPje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c5:b0:381:bc4c:da5b with SMTP id 98e67ed59e1d1-3903c61098cmr5020953a91.18.1785914059234; Wed, 05 Aug 2026 00:14:19 -0700 (PDT) Received: from spider.bream-herring.ts.net ([103.252.203.158]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-390392aef87sm2158639a91.13.2026.08.05.00.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2026 00:14:18 -0700 (PDT) From: Matthias Goergens To: Alexander Viro , Christian Brauner , Jan Kara Cc: Matthias Goergens , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Ansgar=20L=C3=B6=C3=9Fer?= , "Darrick J . Wong" , Dave Chinner , Amir Goldstein Subject: [PATCH 0/2] vfs: report truthful FIDEDUPERANGE progress safely Date: Wed, 5 Aug 2026 15:14:12 +0800 Message-ID: <20260805071414.3414870-1-matthias.goergens@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FIDEDUPERANGE currently reports the requested length even when the filesystem shortens a destination range and deduplicates fewer bytes. A previous one-line correction was reverted after generic/517 exposed the old expectation and reviewers raised the risk that existing consumers could loop on a successful zero-progress result. Patch 1 makes a non-zero request shortened to zero fail per destination with -EINVAL, while preserving explicit zero-length success. Patch 2 then reports the filesystem's actual positive progress. This ordering keeps every intermediate kernel safe for callers that advance by bytes_deduped. The paired fstests update corrects generic/517 and adds raw ioctl coverage for zero-length and mixed multi-destination results. Both tests pass on Btrfs and XFS. Installed duperemove exits successfully on the measured corpus. Installed rmlint does not hang or silently over-report; it exits 1 after the final unaligned tail receives -EINVAL, which is recorded explicitly for review. A current-source consumer audit supports that ABI choice: duperemove completes the request on a non-zero status; rmlint, bees and jdupes surface -EINVAL as failure without retrying; dduper and xfs_io stop but can still report command success. None retries, hangs or risks data corruption. Thus -EINVAL is the only truthful result that also avoids exposing successful zero progress to deployed duperemove binaries. Matthias Goergens (2): vfs: fail dedupe requests that cannot make progress vfs: report the amount of bytes actually deduplicated fs/remap_range.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.55.0